:root {
    --bg: #0b0f19;
    --card-bg: #111827;
    --text: #e5e7eb;
    --accent: #3b82f6;
    --accent-hover: #2563eb;
    --border: #1f2937;
}
* { box-sizing: border-box; margin: 0; padding: 0; font-family: 'Inter', system-ui, sans-serif; }
body { display: flex; flex-direction: column; min-height: 100vh; background: var(--bg); color: var(--text); }
.container { width: 100%; max-width: 1100px; margin: 0 auto; padding: 0 20px; }
header { background: #0f172a; border-bottom: 1px solid var(--border); padding: 15px 0; }
header .container { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; }
.logo { color: var(--text); text-decoration: none; font-weight: 700; }
.lang-switch button { background: #1e293b; color: var(--text); border: 1px solid var(--border); padding: 6px 12px; cursor: pointer; margin-left: 6px; border-radius: 6px; font-size: 12px; transition: 0.2s; }
.lang-switch button.active, .lang-switch button:hover { background: var(--accent); border-color: var(--accent); color: white; }
main { flex: 1; padding: 40px 0; }
h1 { text-align: center; margin-bottom: 30px; font-weight: 800; }
.upload-card { background: var(--card-bg); border: 1px solid var(--border); padding: 25px; border-radius: 12px; text-align: center; margin-bottom: 25px; }
.hidden { display: none; }
.tool-grid { display: flex; gap: 25px; background: var(--card-bg); border: 1px solid var(--border); padding: 25px; border-radius: 12px; }
.cropper-box { flex: 2; max-height: 500px; overflow: hidden; border-radius: 8px; background: #000; }
.cropper-box img { max-width: 100%; display: block; }
.controls { flex: 1; min-width: 250px; }
.controls h2 { font-size: 16px; margin-bottom: 10px; color: #9ca3af; }
button { background: var(--accent); color: white; border: none; padding: 10px 20px; border-radius: 8px; cursor: pointer; font-size: 14px; font-weight: 500; width: 100%; margin-bottom: 10px; transition: 0.2s; }
button:hover { background: var(--accent-hover); }
.grid-inputs { display: flex; gap: 10px; margin-bottom: 15px; }
.grid-inputs input { width: 50%; padding: 10px; border: 1px solid var(--border); border-radius: 8px; background: #0b0f19; color: var(--text); }
.grid-results { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 25px; }
.grid-results a { background: #1e293b; padding: 10px 15px; border-radius: 8px; text-decoration: none; color: var(--text); font-size: 13px; border: 1px solid var(--border); transition: 0.2s; }
.grid-results a:hover { background: var(--accent); border-color: var(--accent); }
footer { background: #0f172a; border-top: 1px solid var(--border); padding: 25px 0; text-align: center; font-size: 14px; color: #9ca3af; }
.footer-links { margin-top: 12px; display: flex; justify-content: center; gap: 15px; flex-wrap: wrap; }
.footer-links a { color: var(--text); text-decoration: none; }
.footer-links a:hover { color: var(--accent); }

/* --- Мобильная адаптация --- */
@media (max-width: 768px) {
    main { padding: 20px 0; }
    h1 { font-size: 24px; }
    header .container { justify-content: center; flex-direction: column; }
    .lang-switch button { margin: 0 3px; padding: 8px 15px; }
    .tool-grid { flex-direction: column; padding: 15px; gap: 15px; }
    .cropper-box { max-height: 350px; }
    .controls { min-width: 100%; }
    .grid-results a { flex: 1 1 45%; text-align: center; padding: 12px 10px; }
}