:root {
  --bg: #eef2fb;
  --card: #ffffff;
  --ink: #121826;
  --muted: #5b6575;
  --border: #e4e8f1;
  --accent: #4f8ef7;
  --accent-dark: #3c78e0;
  --shadow: 0 20px 50px rgba(15, 23, 42, 0.12);
  --radius: 18px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Space Grotesk", system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--ink);
}

.page {
  min-height: 100vh;
  padding: 40px 16px 60px;
}

.card {
  max-width: 1100px;
  margin: 0 auto;
  background: var(--card);
  border-radius: 24px;
  padding: 28px 28px 36px;
  box-shadow: var(--shadow);
}

.header {
  text-align: center;
}

.header h1 {
  margin: 0 0 10px;
  font-size: 28px;
  font-weight: 700;
}

.header p {
  margin: 0 auto;
  max-width: 640px;
  color: var(--muted);
  font-size: 15px;
}

.layout {
  display: grid;
  grid-template-columns: 1.25fr 1fr;
  gap: 24px;
  margin-top: 26px;
}

.preview {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.preview-card {
  background: #f7f9fc;
  border-radius: 16px;
  padding: 18px;
  border: 1px solid var(--border);
}

.preview-card img {
  width: 100%;
  border-radius: 14px;
  object-fit: cover;
  aspect-ratio: 16 / 10;
  display: block;
}

.controls {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.control-card {
  background: #f7f9fc;
  border-radius: 16px;
  padding: 16px;
  border: 1px solid var(--border);
}

.control-title {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 12px;
}

.row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
  position: relative;
}

.row label {
  flex: 1;
  font-size: 12px;
  color: var(--muted);
  pointer-events: none;
}

.row input[type="range"] {
  width: 100%;
  flex: 1;
  min-width: 0;
  cursor: pointer;
  position: relative;
  z-index: 1;
  pointer-events: auto;
  -webkit-appearance: auto;
  appearance: auto;
}

.row output {
  font-size: 12px;
  color: var(--muted);
  min-width: 40px;
  text-align: right;
  pointer-events: none;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.button {
  border: none;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  padding: 10px 16px;
  border-radius: 10px;
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease;
}

.button:hover {
  background: var(--accent-dark);
  transform: translateY(-1px);
}

.button.secondary {
  background: #e6ecfb;
  color: #2a3a57;
}

.button.secondary:hover {
  background: #d9e3fb;
}

.file-input {
  display: flex;
  align-items: center;
  gap: 10px;
}

.file-input input {
  flex: 1;
}

select,
input[type="text"] {
  width: 100%;
  padding: 9px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #fff;
  font-family: inherit;
}

.notice {
  font-size: 12px;
  color: var(--muted);
}

.group-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.group-grid .control-card {
  padding: 14px;
}

.group-grid .row {
  flex-wrap: wrap;
  gap: 6px 10px;
}

.group-grid .row label {
  flex: 0 0 100%;
}

.group-grid .row input[type="range"] {
  flex: 1 1 auto;
}

@media (max-width: 960px) {
  .layout {
    grid-template-columns: 1fr;
  }
  .group-grid {
    grid-template-columns: 1fr;
  }
}
