:root { --primary: #4f46e5; --bg: #f8fafc; --text: #1e293b; --success: #16a34a; --border: #e2e8f0; --danger: #ef4444; }
* { box-sizing: border-box; outline: none; }
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; background: var(--bg); color: var(--text); padding: 0; margin: 0; line-height: 1.6; }

/* Layout */
.wrapper { max-width: 1100px; margin: 0 auto; padding: 20px; }
.nav-bar { background: white; padding: 15px 20px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; }
.logo { font-weight: 900; font-size: 1.2rem; color: var(--primary); text-decoration: none; }

header { text-align: center; margin: 40px 0; }
h1 { color: var(--primary); margin: 0 0 10px 0; font-size: 2.2rem; line-height: 1.2; }
.subtitle { color: #64748b; font-size: 1.1rem; max-width: 600px; margin: 0 auto; }

/* Tool Container */
.tool-container { background: white; padding: 30px; border-radius: 16px; box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1); margin-bottom: 40px; }
.grid-layout { display: grid; grid-template-columns: 1fr 1.2fr; gap: 40px; }
@media (max-width: 900px) { .grid-layout { grid-template-columns: 1fr; } }

/* Inputs */
.input-row { display: flex; gap: 15px; margin-bottom: 20px; }
.input-group { flex: 1; }
label { display: block; font-size: 0.75rem; font-weight: 800; margin-bottom: 6px; color: #64748b; text-transform: uppercase; letter-spacing: 0.05em; }
input[type="number"] { width: 100%; padding: 12px; border: 2px solid var(--border); border-radius: 8px; font-weight: bold; font-size: 1rem; color: #333; transition: 0.2s; }
input[type="number"]:focus { border-color: var(--primary); }

/* File Upload */
.upload-area { border: 2px dashed #cbd5e1; border-radius: 12px; padding: 40px 20px; text-align: center; cursor: pointer; background: #f8fafc; transition: 0.2s; margin-bottom: 20px; position: relative; }
.upload-area:hover { border-color: var(--primary); background: #eef2ff; }
.upload-icon { font-size: 2.5rem; display: block; margin-bottom: 10px; }

/* Controls */
.control-panel { background: #fffbeb; padding: 20px; border-radius: 12px; margin-top: 20px; border: 1px solid #fcd34d; display: none; }
.slider-row { display: flex; align-items: center; gap: 15px; margin-bottom: 12px; }
.slider-label { width: 100px; font-weight: bold; font-size: 0.85rem; color: #92400e; }
input[type=range] { flex: 1; cursor: pointer; accent-color: var(--primary); height: 6px; }

/* Results */
.result-area { display: none; margin-top: 0; }
.comparison-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 600px) { .comparison-grid { grid-template-columns: 1fr; } }

.preview-box { background: white; padding: 15px; border-radius: 12px; border: 1px solid var(--border); text-align: center; }
.preview-box img { max-width: 100%; height: auto; max-height: 250px; object-fit: contain; border-radius: 4px; box-shadow: 0 2px 4px rgba(0,0,0,0.05); background: #eee; }

.box-title { font-weight: bold; font-size: 0.9rem; margin-bottom: 10px; display: block; }
.original-title { color: #64748b; }
.final-title { color: var(--success); }

.stat-badge { display: inline-block; padding: 4px 10px; border-radius: 4px; font-size: 0.8rem; font-weight: bold; margin: 5px 2px; background: #f1f5f9; color: #475569; }
.stat-badge.green { background: #dcfce7; color: #166534; }

.download-btn { display: block; width: 100%; background: var(--success); color: white; padding: 14px; text-decoration: none; border-radius: 8px; font-weight: bold; font-size: 1rem; margin-top: 20px; box-shadow: 0 4px 6px -1px rgba(22, 163, 74, 0.4); transition: 0.2s; cursor: pointer; border: none; text-align: center; }
.download-btn:hover { background: #15803d; transform: translateY(-2px); }

/* SEO Content */
.content-wrapper { max-width: 800px; margin: 0 auto; }
.seo-content { background: white; padding: 40px; border-radius: 16px; margin-bottom: 40px; border: 1px solid var(--border); }
.seo-content h2 { color: var(--primary); margin-top: 0; }


.link-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 15px; margin-top: 30px; }
.link-card { background: white; padding: 15px; border: 1px solid var(--border); border-radius: 8px; text-decoration: none; color: var(--text); font-weight: 500; font-size: 0.9rem; transition: 0.2s; display: block; }
.link-card:hover { border-color: var(--primary); color: var(--primary); transform: translateY(-2px); }

footer { text-align: center; padding: 40px 20px; color: #64748b; font-size: 0.9rem; border-top: 1px solid var(--border); margin-top: 40px; }

/* Placeholder */
#placeholder { background:#f8fafc; height:300px; border-radius:12px; border: 2px dashed #cbd5e1; display:flex; align-items:center; justify-content:center; color:#94a3b8; font-weight:bold; flex-direction: column; }