/* ===== Variables ===== */
:root {
    --primary: #2563EB;
    --primary-dark: #1D4ED8;
    --primary-light: #DBEAFE;
    --success: #10B981;
    --success-dark: #059669;
    --accent: #F59E0B;
    --bg: #FAFBFC;
    --bg-white: #FFFFFF;
    --text: #1E293B;
    --text-light: #64748B;
    --text-lighter: #94A3B8;
    --border: #E2E8F0;
    --radius: 12px;
    --radius-sm: 8px;
    --shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.04);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.1);
    --transition: 200ms ease;
    --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --max-width: 1200px;
}

/* ===== Reset ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
    font-family: var(--font);
    color: var(--text);
    background: var(--bg);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}
a { color: var(--primary); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--primary-dark); }
img { max-width: 100%; display: block; }
button, input, select, textarea { font-family: inherit; font-size: inherit; }

/* ===== Layout ===== */
.container { max-width: var(--max-width); margin: 0 auto; padding: 0 1rem; }

/* ===== Header ===== */
.header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--bg-white);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow);
}
.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 56px;
}
.logo {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--primary);
    letter-spacing: -0.02em;
}
.logo span { color: var(--accent); }
.nav { display: flex; gap: 0.25rem; }
.nav a {
    padding: 0.4rem 0.75rem;
    border-radius: var(--radius-sm);
    color: var(--text);
    font-size: 0.875rem;
    font-weight: 500;
    transition: background var(--transition), color var(--transition);
}
.nav a:hover { background: var(--primary-light); color: var(--primary); }
.nav-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text);
    padding: 0.25rem;
}

/* ===== Ad Slots ===== */
.ad-slot {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg);
    border: 1px dashed var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-lighter);
    font-size: 0.75rem;
    margin: 1rem auto;
    max-width: 728px;
}
.ad-banner { height: 90px; }
.ad-rectangle { width: 336px; height: 280px; }

/* ===== Hero ===== */
.hero {
    text-align: center;
    padding: 3rem 1rem 2rem;
}
.hero h1 {
    font-size: 2.25rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.2;
    margin-bottom: 0.75rem;
}
.hero h1 .highlight { color: var(--primary); }
.hero p {
    font-size: 1.125rem;
    color: var(--text-light);
    max-width: 520px;
    margin: 0 auto;
}

/* ===== Search ===== */
.search-box {
    max-width: 480px;
    margin: 1.5rem auto 0;
    position: relative;
}
.search-box input {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 2.75rem;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    font-size: 1rem;
    background: var(--bg-white);
    transition: border-color var(--transition), box-shadow var(--transition);
}
.search-box input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}
.search-box .search-icon {
    position: absolute;
    left: 0.875rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-lighter);
    font-size: 1.1rem;
    pointer-events: none;
}

/* ===== Tool Cards ===== */
.section-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 1rem;
    padding-left: 0.25rem;
}
.tools-section { margin-bottom: 2.5rem; }
.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1rem;
}
.tool-card {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    transition: box-shadow var(--transition), transform var(--transition);
    cursor: pointer;
    text-decoration: none;
    color: var(--text);
}
.tool-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
    color: var(--text);
}
.tool-card .icon {
    font-size: 1.75rem;
    flex-shrink: 0;
    width: 2.5rem;
    text-align: center;
}
.tool-card .info h3 {
    font-size: 0.9rem;
    font-weight: 600;
    line-height: 1.3;
}
.tool-card .info p {
    font-size: 0.8rem;
    color: var(--text-light);
    line-height: 1.4;
}
.tool-card.disabled {
    opacity: 0.5;
    pointer-events: none;
}

/* ===== Why Section ===== */
.why-section {
    padding: 3rem 0;
    border-top: 1px solid var(--border);
}
.why-section h2 { text-align: center; margin-bottom: 2rem; font-size: 1.5rem; }
.why-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
}
.why-card {
    text-align: center;
    padding: 1.5rem 1rem;
}
.why-card .why-icon { font-size: 2rem; margin-bottom: 0.75rem; }
.why-card h3 { font-size: 1rem; font-weight: 600; margin-bottom: 0.25rem; }
.why-card p { font-size: 0.875rem; color: var(--text-light); }

/* ===== Tool Page ===== */
.tool-hero {
    text-align: center;
    padding: 2rem 1rem;
}
.tool-hero h1 {
    font-size: 1.75rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
}
.tool-hero p {
    color: var(--text-light);
    font-size: 1rem;
}

/* Drop Zone */
.drop-zone {
    max-width: 600px;
    margin: 0 auto 2rem;
    padding: 3rem 2rem;
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    background: var(--bg-white);
    text-align: center;
    cursor: pointer;
    transition: border-color var(--transition), background var(--transition);
}
.drop-zone:hover, .drop-zone.dragover {
    border-color: var(--primary);
    background: var(--primary-light);
}
.drop-zone .drop-icon { font-size: 2.5rem; margin-bottom: 0.75rem; }
.drop-zone p { color: var(--text-light); margin-bottom: 0.5rem; }
.drop-zone .drop-hint { font-size: 0.8rem; color: var(--text-lighter); }
.drop-zone .file-name {
    margin-top: 0.75rem;
    font-weight: 600;
    color: var(--primary);
    display: none;
}
.drop-zone .file-name.show { display: block; }

/* File list (multi-file upload) */
.file-list {
    max-width: 600px;
    margin: 0 auto 1rem;
    display: none;
}
.file-list.show { display: block; }
.file-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: var(--bg-white);
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 8px;
}
.file-item .file-order {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--primary-light);
    color: var(--primary-dark, var(--primary));
    font-size: 0.8rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}
.file-item .file-icon {
    flex-shrink: 0;
    font-size: 1.25rem;
}
.file-item .file-name {
    flex: 1;
    min-width: 0;
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: left;
}
.file-item .file-size {
    flex-shrink: 0;
    font-size: 0.85rem;
    color: var(--text-lighter);
}
.file-item .file-remove {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    border: none;
    border-radius: 50%;
    background: #E2E8F0;
    color: var(--text-light);
    font-size: 1rem;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 200ms ease, color 200ms ease;
}
.file-item .file-remove:hover {
    background: #DC2626;
    color: #fff;
}

/* Add more files button */
.btn-add-more {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 1rem;
    border: 2px dashed var(--border);
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--text-light);
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background var(--transition), border-color var(--transition), color var(--transition);
}
.btn-add-more:hover {
    background: #F8FAFC;
    border-color: var(--primary);
    color: var(--primary);
}
.btn-add-more::before {
    content: "+";
    font-size: 1.1rem;
    font-weight: 700;
    line-height: 1;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    border: none;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background var(--transition), transform var(--transition);
}
.btn:active { transform: scale(0.97); }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); color: #fff; }
.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { background: var(--success-dark); color: #fff; }
.btn-outline {
    background: transparent;
    border: 2px solid var(--border);
    color: var(--text);
}
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }

/* Progress Bar */
.progress-container {
    max-width: 600px;
    margin: 0 auto 1.5rem;
    display: none;
}
.progress-container.show { display: block; }
.progress-bar-bg {
    height: 8px;
    background: var(--border);
    border-radius: 4px;
    overflow: hidden;
}
.progress-bar-fill {
    height: 100%;
    background: var(--primary);
    border-radius: 4px;
    width: 0%;
    transition: width 300ms ease;
}
.progress-text {
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-light);
    margin-top: 0.5rem;
}

/* Result Zone */
.result-zone {
    max-width: 600px;
    margin: 0 auto 2rem;
    padding: 1.5rem;
    background: #ECFDF5;
    border: 1px solid #A7F3D0;
    border-radius: var(--radius);
    text-align: center;
    display: none;
}
.result-zone.show { display: block; }
.result-zone .result-stats {
    font-size: 0.9rem;
    color: var(--text-light);
    margin-bottom: 1rem;
}
.result-zone .result-stats strong { color: var(--success-dark); }

/* Result zone — warning variant (file already optimised) */
.result-zone.result-warning {
    background: #FFFBEB;
    border-color: #FCD34D;
}
.result-zone.result-warning .warning-msg {
    color: #92400E;
    font-weight: 600;
}
.result-zone.result-warning .btn-success {
    background: #F59E0B;
}
.result-zone.result-warning .btn-success:hover {
    background: #D97706;
}

/* Error */
.error-zone {
    max-width: 600px;
    margin: 0 auto 1.5rem;
    padding: 1rem;
    background: #FEF2F2;
    border: 1px solid #FECACA;
    border-radius: var(--radius-sm);
    color: #DC2626;
    font-size: 0.9rem;
    text-align: center;
    display: none;
}
.error-zone.show { display: block; }

/* Options */
.tool-options {
    max-width: 600px;
    margin: 0 auto 2rem;
    padding: 1.25rem;
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}
.tool-options h3 { font-size: 0.95rem; margin-bottom: 0.75rem; }

.split-info {
    max-width: 600px;
    margin: 0 auto 1rem;
    font-size: 0.95rem;
    color: var(--text);
    text-align: center;
    padding: 0.75rem 1rem;
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
}
.split-info strong { color: var(--primary-dark, var(--primary)); }

/* Mode selection cards (used on Diviser PDF) */
.mode-cards {
    max-width: 600px;
    margin: 0 auto 1.5rem;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}
.mode-cards.cols-3 { grid-template-columns: 1fr 1fr 1fr; }
.mode-card .mode-icon svg {
    display: block;
    color: var(--primary);
}
.mode-card {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 1.25rem 1rem;
    background: var(--bg-white);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    transition: border-color var(--transition), background var(--transition), transform var(--transition);
}
.mode-card:hover { border-color: var(--primary); }
.mode-card.active {
    border-color: var(--primary);
    background: var(--primary-light);
}
.mode-card input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}
.mode-card .mode-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}
.mode-card .mode-title {
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--text);
    margin-bottom: 0.25rem;
}
.mode-card .mode-desc {
    font-size: 0.8rem;
    color: var(--text-light);
}

/* Help box (syntax examples) */
.help-box {
    max-width: 600px;
    margin: 0 auto 1.5rem;
    padding: 1.25rem;
    background: #F8FAFC;
    border: 1px solid var(--border);
    border-radius: var(--radius);
}
.help-box h3 {
    font-size: 0.95rem;
    margin-bottom: 0.75rem;
    color: var(--text);
}
.examples-row {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
}
.example {
    flex: 1 1 0;
    min-width: 120px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
}
.example-badge {
    display: inline-block;
    padding: 0.4rem 0.75rem;
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: 999px;
    font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--primary-dark, var(--primary));
}
.example-legend {
    font-size: 0.75rem;
    color: var(--text-light);
    text-align: center;
}
.help-note {
    font-size: 0.8rem;
    color: var(--text-lighter);
    margin-bottom: 0.75rem;
}

.mode-note {
    max-width: 600px;
    margin: 0 auto 1.5rem;
    padding: 0.85rem 1rem;
    background: #F8FAFC;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    color: var(--text-light);
    text-align: center;
}

.split-pages-field label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-light);
    margin-bottom: 0.4rem;
}
.split-pages-field input[type="text"] {
    width: 100%;
    padding: 0.6rem 0.8rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    font-family: inherit;
    box-sizing: border-box;
}
.split-pages-field input[type="text"]:focus {
    outline: none;
    border-color: var(--primary);
}
.help-box .split-pages-field { margin-top: 0.5rem; }

.password-card {
  max-width: 500px;
  margin: 0 auto 24px auto;
  background: #fff;
  border: 1px solid #E2E8F0;
  border-radius: 12px;
  padding: 32px;
  text-align: center;
}

.password-card .password-icon {
  font-size: 36px;
  margin-bottom: 12px;
}

.password-card h3 {
  font-size: 1.2rem;
  font-weight: 600;
  color: #1E293B;
  margin-bottom: 4px;
}

.password-card .password-hint {
  font-size: 0.9rem;
  color: #94A3B8;
  margin-bottom: 20px;
}

.password-field-wrapper {
  position: relative;
  max-width: 400px;
  margin: 0 auto 12px auto;
}

.password-field-wrapper input {
  width: 100%;
  padding: 12px 48px 12px 16px;
  border: 1px solid #E2E8F0;
  border-radius: 8px;
  font-size: 1rem;
  color: #1E293B;
  background: #fff;
  transition: border-color 200ms;
  box-sizing: border-box;
}

.password-field-wrapper input:focus {
  outline: none;
  border-color: #2563EB;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.password-field-wrapper input::placeholder {
  color: #CBD5E1;
}

.password-toggle {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.2rem;
  color: #94A3B8;
  padding: 4px;
  line-height: 1;
}

.password-toggle:hover {
  color: #64748B;
}

.password-strength {
  max-width: 400px;
  margin: 0 auto 8px auto;
}

.password-strength-bar {
  height: 4px;
  border-radius: 2px;
  background: #E2E8F0;
  overflow: hidden;
  margin-bottom: 4px;
}

.password-strength-bar-fill {
  height: 100%;
  border-radius: 2px;
  transition: width 300ms, background-color 300ms;
}

.password-strength-bar-fill.weak { width: 33%; background: #EF4444; }
.password-strength-bar-fill.medium { width: 66%; background: #F59E0B; }
.password-strength-bar-fill.strong { width: 100%; background: #10B981; }

.password-strength-label {
  font-size: 0.8rem;
  text-align: right;
}

.password-strength-label.weak { color: #EF4444; }
.password-strength-label.medium { color: #F59E0B; }
.password-strength-label.strong { color: #10B981; }

.password-error {
  max-width: 400px;
  margin: 0 auto 8px auto;
  font-size: 0.85rem;
  color: #EF4444;
  text-align: left;
}

@media (max-width: 640px) {
    .mode-cards,
    .mode-cards.cols-3 { grid-template-columns: 1fr; }
    .examples-row { flex-direction: column; }
    .example { min-width: 0; }
}

/* SEO Content */
.seo-content {
    max-width: 720px;
    margin: 2rem auto;
    padding: 0 1rem;
}
.seo-content h2 {
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
}
.seo-content p {
    color: var(--text-light);
    font-size: 0.95rem;
    margin-bottom: 1rem;
    line-height: 1.7;
}

/* FAQ */
.faq-section {
    max-width: 720px;
    margin: 2rem auto;
    padding: 0 1rem;
}
.faq-section h2 { font-size: 1.25rem; margin-bottom: 1rem; }
.faq-item {
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    margin-bottom: 0.75rem;
    overflow: hidden;
}
.faq-question {
    width: 100%;
    padding: 1rem;
    background: var(--bg-white);
    border: none;
    text-align: left;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background var(--transition);
}
.faq-question:hover { background: var(--bg); }
.faq-question .arrow {
    transition: transform var(--transition);
    font-size: 0.75rem;
    color: var(--text-light);
}
.faq-item.open .faq-question .arrow { transform: rotate(180deg); }
.faq-answer {
    padding: 0 1rem;
    max-height: 0;
    overflow: hidden;
    transition: max-height 300ms ease, padding 300ms ease;
    color: var(--text-light);
    font-size: 0.9rem;
    line-height: 1.6;
}
.faq-item.open .faq-answer {
    max-height: 300px;
    padding: 0 1rem 1rem;
}

/* Related Tools */
.related-tools {
    max-width: 720px;
    margin: 2rem auto;
    padding: 0 1rem;
}
.related-tools h2 { font-size: 1.25rem; margin-bottom: 1rem; }
.related-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 0.75rem;
}

/* ===== Footer ===== */
.footer {
    border-top: 1px solid var(--border);
    padding: 2rem 0;
    margin-top: 2rem;
    text-align: center;
}
.footer-links {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}
.footer-links a { color: var(--text-light); font-size: 0.875rem; }
.footer-links a:hover { color: var(--primary); }
.footer-copy { font-size: 0.8rem; color: var(--text-lighter); }

/* ===== Cookie Banner ===== */
.cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--bg-white);
    border-top: 1px solid var(--border);
    box-shadow: 0 -2px 12px rgba(0,0,0,0.08);
    padding: 1rem;
    z-index: 200;
    display: none;
}
.cookie-banner.show { display: block; }
.cookie-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}
.cookie-inner p { font-size: 0.85rem; color: var(--text-light); flex: 1; }
.cookie-buttons { display: flex; gap: 0.5rem; }

/* ===== Static Pages ===== */
.static-page {
    max-width: 720px;
    margin: 2rem auto;
    padding: 0 1rem;
}
.static-page h1 { font-size: 1.75rem; margin-bottom: 1.5rem; }
.static-page h2 { font-size: 1.25rem; margin-top: 1.5rem; margin-bottom: 0.5rem; }
.static-page p { color: var(--text-light); line-height: 1.7; margin-bottom: 1rem; }

/* ===== Crop Editor ===== */
.crop-editor-layout {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 24px;
    align-items: start;
    margin-bottom: 1.5rem;
}
.crop-workspace {
    background: #F1F5F9;
    border: 1px solid #E2E8F0;
    border-radius: 12px;
    padding: 20px;
    min-height: 300px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}
.crop-hint {
    font-size: 0.85rem;
    color: #64748B;
    margin: 0 0 12px;
    text-align: center;
}
.crop-image-wrapper {
    position: relative;
    max-width: 100%;
    max-height: 500px;
    display: inline-block;
    line-height: 0;
    user-select: none;
    -webkit-user-select: none;
    touch-action: none;
}
.crop-image-wrapper img,
.crop-image {
    display: block;
    max-width: 100%;
    max-height: 500px;
    width: auto;
    height: auto;
    -webkit-user-drag: none;
    user-select: none;
    pointer-events: none;
}
.crop-overlay-mask {
    position: absolute;
    background: rgba(0, 0, 0, 0.5);
    pointer-events: none;
    z-index: 1;
}
.crop-selection {
    position: absolute;
    border: 2px solid #2563EB;
    box-sizing: border-box;
    cursor: move;
    z-index: 2;
}
.crop-handle {
    position: absolute;
    width: 12px;
    height: 12px;
    background: #FFFFFF;
    border: 2px solid #2563EB;
    box-sizing: border-box;
    border-radius: 2px;
    z-index: 3;
}
.crop-handle-n  { top: -7px;    left: 50%;   transform: translateX(-50%); cursor: ns-resize; }
.crop-handle-s  { bottom: -7px; left: 50%;   transform: translateX(-50%); cursor: ns-resize; }
.crop-handle-e  { right: -7px;  top: 50%;    transform: translateY(-50%); cursor: ew-resize; }
.crop-handle-w  { left: -7px;   top: 50%;    transform: translateY(-50%); cursor: ew-resize; }
.crop-handle-nw { top: -7px;    left: -7px;                               cursor: nwse-resize; }
.crop-handle-se { bottom: -7px; right: -7px;                              cursor: nwse-resize; }
.crop-handle-ne { top: -7px;    right: -7px;                              cursor: nesw-resize; }
.crop-handle-sw { bottom: -7px; left: -7px;                               cursor: nesw-resize; }
.crop-info-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    margin-top: 16px;
    gap: 1rem;
    font-size: 0.9rem;
    color: #475569;
}
.crop-info-bar .crop-dimensions,
.crop-info-bar .crop-dims { font-weight: 600; color: #1E293B; }
.btn-restart {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 8px;
    border: 1px solid #E2E8F0;
    background: #fff;
    color: #64748B;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background 200ms, color 200ms, border-color 200ms;
}
.btn-restart:hover {
    background: #F8FAFC;
    color: #1E293B;
    border-color: #CBD5E1;
}
.crop-sidebar {
    position: sticky;
    top: 20px;
    background: #fff;
    border: 1px solid #E2E8F0;
    border-radius: 12px;
    padding: 20px;
}
.crop-sidebar h3 {
    font-size: 1rem;
    font-weight: 600;
    margin: 0 0 12px;
    color: #1E293B;
}
.crop-sidebar h4 {
    font-size: 0.9rem;
    font-weight: 600;
    margin: 20px 0 12px;
    color: #1E293B;
}
.crop-sidebar .mode-cards.crop-ratio-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    grid-template-columns: none;
    max-width: none;
}
.crop-sidebar .mode-card {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    text-align: left;
}
.crop-sidebar .mode-card .mode-icon {
    font-size: 28px;
    flex-shrink: 0;
    margin: 0;
}
.crop-sidebar .mode-card .mode-text {
    display: flex;
    flex-direction: column;
}
.crop-sidebar .mode-card .mode-title {
    font-weight: 600;
    color: #1E293B;
    font-size: 0.95rem;
    margin: 0;
}
.crop-sidebar .mode-card .mode-subtitle {
    font-size: 0.8rem;
    color: #94A3B8;
}
.crop-preview-wrapper {
    width: 100%;
    background: #F8FAFC;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    padding: 12px;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 120px;
    overflow: hidden;
    box-sizing: border-box;
}
.crop-preview-wrapper canvas {
    max-width: 100%;
    max-height: 200px;
    display: block;
}
.crop-sidebar .btn-submit,
.crop-sidebar #process-btn {
    display: block;
    width: 100%;
    margin-top: 20px;
    padding: 0.85rem 1rem;
    font-size: 1rem;
}
@media (max-width: 900px) {
    .crop-editor-layout {
        grid-template-columns: 1fr;
    }
    .crop-sidebar {
        position: static;
    }
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .nav-toggle { display: block; }
    .nav {
        display: none;
        position: absolute;
        top: 56px;
        left: 0;
        right: 0;
        background: var(--bg-white);
        border-bottom: 1px solid var(--border);
        flex-direction: column;
        padding: 0.5rem;
    }
    .nav.open { display: flex; }
    .hero h1 { font-size: 1.75rem; }
    .tools-grid { grid-template-columns: 1fr 1fr; }
    .why-grid { grid-template-columns: 1fr 1fr; }
    .ad-slot.ad-banner { height: 60px; max-width: 100%; }
    .ad-slot.ad-rectangle { width: 100%; max-width: 336px; }
    .drop-zone { padding: 2rem 1rem; }
    .cookie-inner { flex-direction: column; text-align: center; }
}
@media (max-width: 480px) {
    .tools-grid { grid-template-columns: 1fr; }
    .why-grid { grid-template-columns: 1fr; }
    .related-grid { grid-template-columns: 1fr 1fr; }
}

/* ===== Remove BG (transparent preview + info banner) ===== */
.info-banner {
    display: flex;
    align-items: center;
    gap: 10px;
    max-width: 900px;
    margin: 0 auto 1.25rem;
    padding: 12px 16px;
    background: #EFF6FF;
    border: 1px solid #BFDBFE;
    border-radius: 10px;
    color: #1E3A8A;
    font-size: 0.92rem;
}
.info-banner-icon {
    flex-shrink: 0;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #2563EB;
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
}
.transparent-bg {
    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: 20px 20px;
    background-position: 0 0, 0 10px, 10px -10px, 10px 0px;
    background-color: #F8FAFC;
}
.removebg-preview {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0 auto 1rem;
    padding: 16px;
    border: 1px solid #E2E8F0;
    border-radius: 12px;
    max-width: 100%;
    overflow: hidden;
}
.removebg-preview img {
    max-width: 100%;
    max-height: 480px;
    height: auto;
    display: block;
}
