* { box-sizing: border-box; }
:root {
  --bg: #f6f8fc;
  --ink: #172033;
  --muted: #667085;
  --blue: #2563eb;
  --blue-dark: #1d4ed8;
  --panel: #ffffff;
  --line: #d9e2f2;
  --soft: #eef5ff;
  --green: #0f766e;
}
body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  background: var(--bg);
  color: var(--ink);
}
.hero-bg {
  background:
    radial-gradient(circle at 15% 20%, rgba(37,99,235,0.20), transparent 30%),
    radial-gradient(circle at 85% 0%, rgba(15,118,110,0.18), transparent 28%),
    linear-gradient(135deg, #eef6ff 0%, #ffffff 58%, #f0fdfa 100%);
  border-bottom: 1px solid var(--line);
}
.topbar {
  max-width: 1180px;
  margin: 0 auto;
  padding: 20px 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--blue), var(--green));
  color: white;
  display: grid;
  place-items: center;
  font-weight: 800;
  letter-spacing: -1px;
}
.brand-name { font-size: 1.25rem; font-weight: 800; }
.brand-sub { color: var(--muted); font-size: 0.9rem; margin-top: 2px; }
.nav-note {
  background: white;
  border: 1px solid var(--line);
  padding: 8px 12px;
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.9rem;
}
.hero {
  max-width: 1180px;
  margin: 0 auto;
  padding: 28px 18px 46px;
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 28px;
  align-items: center;
}
.hero h1 {
  font-size: clamp(2rem, 4vw, 3.25rem);
  line-height: 1.05;
  margin: 0 0 16px;
  letter-spacing: -1.3px;
}
.hero p {
  margin: 0;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.55;
  max-width: 720px;
}
.feature-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}
.feature-pills span {
  background: white;
  border: 1px solid var(--line);
  color: #344054;
  padding: 9px 12px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.92rem;
}
.hero-card {
  background: rgba(255,255,255,0.88);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 22px;
  box-shadow: 0 14px 35px rgba(23,32,51,0.08);
}
.hero-card strong { display: block; margin-bottom: 5px; }
.hero-card p { font-size: 0.96rem; margin: 0 0 16px; }
.container {
  max-width: 1180px;
  margin: 0 auto;
  padding: 28px 18px 38px;
}
.app-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: 0 12px 36px rgba(23,32,51,0.08);
  padding: 24px;
  display: grid;
  grid-template-columns: 410px 1fr;
  gap: 24px;
}
.controls h2 { margin: 0 0 6px; font-size: 1.5rem; }
.section-note { margin: 0 0 18px; color: var(--muted); }
.field { margin-bottom: 14px; }
.field label { display: block; margin-bottom: 6px; font-weight: 700; }
.field small { display: block; margin-top: 6px; color: var(--muted); }
input[type="file"],
select,
input[type="number"] {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid #cfd8e8;
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
}
input[type="range"] { width: 100%; accent-color: var(--blue); }
.row.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.checkbox-row { display: flex; gap: 16px; flex-wrap: wrap; }
.checkbox-row label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
}
.mode-description {
  background: var(--soft);
  border: 1px solid #dbeafe;
  color: #1e3a8a;
  border-radius: 14px;
  padding: 11px 12px;
  font-size: 0.95rem;
  margin-bottom: 14px;
  line-height: 1.45;
}
.sub-options.hidden { display: none; }
.slider-box {
  background: #f8fbff;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px;
  margin-bottom: 14px;
}
.export-tiers {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 18px;
}
.tier {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px;
  background: white;
}
.tier strong { display: block; margin-bottom: 4px; }
.tier span {
  display: inline-block;
  margin-bottom: 6px;
  font-size: 0.85rem;
  font-weight: 700;
}
.tier p {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.4;
}
.tier.active {
  background: #eff6ff;
  border-color: #93c5fd;
}
.tier.active span { color: #1d4ed8; }
.tier.locked { opacity: 0.85; }
.tier.locked span { color: #b45309; }
.buttons {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 18px;
}
button {
  border: none;
  border-radius: 12px;
  padding: 13px 17px;
  font-weight: 800;
  cursor: pointer;
}
#processBtn { background: var(--blue); color: white; }
#processBtn:hover { background: var(--blue-dark); }
#downloadBtn { background: #111827; color: white; }
button:disabled { opacity: 0.55; cursor: not-allowed; }
.status {
  margin-top: 14px;
  padding: 11px 12px;
  border-radius: 12px;
  background: #eef2ff;
  color: #3730a3;
}
.previews {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  min-width: 0;
}
.preview-box { min-width: 0; }
.preview-title {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 10px;
}
.preview-title h3 { margin: 0; }
.preview-title span { color: var(--muted); font-size: 0.9rem; }
.preview-stage {
  border: 1px solid var(--line);
  background:
    linear-gradient(45deg,#f7f9fc 25%,transparent 25%),
    linear-gradient(-45deg,#f7f9fc 25%,transparent 25%),
    linear-gradient(45deg,transparent 75%,#f7f9fc 75%),
    linear-gradient(-45deg,transparent 75%,#f7f9fc 75%);
  background-size: 22px 22px;
  background-position: 0 0,0 11px,11px -11px,-11px 0;
  border-radius: 18px;
  height: 500px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.preview-stage img {
  max-width: 100%;
  max-height: 100%;
  display: none;
}
.preview-stage img.active { display: block; }
.info-grid {
  margin-top: 24px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.info-grid > div {
  background: white;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 18px;
}
.info-grid h3 { margin: 0 0 8px; }
.info-grid p { margin: 0; color: var(--muted); line-height: 1.45; }
code {
  background: #f3f4f6;
  padding: 2px 6px;
  border-radius: 6px;
}
footer {
  text-align: center;
  color: var(--muted);
  padding: 10px 18px 30px;
}
@media (max-width: 1000px) {
  .hero, .app-card { grid-template-columns: 1fr; }
  .hero-card { max-width: 520px; }
}
@media (max-width: 760px) {
  .topbar { align-items: flex-start; gap: 14px; flex-direction: column; }
  .previews, .info-grid, .row.two-col, .export-tiers { grid-template-columns: 1fr; }
  .preview-stage { height: 340px; }
}
