:root{
  --bg:#f9f9fb; --fg:#0d0e12; --muted:#666a73; --card:#ffffff; --border:#e7e8ec;
  --brand:#3f72af; --brand-fg:#fff; --btn:#e5eaf5; --btn-fg:#0d0e12; --focus:#3f72af55;
}
html[data-theme="dark"]{
  --bg:#0b0c10; --fg:#e8e8ee; --muted:#a0a3ad; --card:#12141a; --border:#242632;
  --brand:#6ea8ff; --brand-fg:#0b0c10; --btn:#1a1d26; --btn-fg:#e8e8ee; --focus:#6ea8ff55;
}
*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0; background:var(--bg); color:var(--fg);
  font:16px/1.45 system-ui,-apple-system,Segoe UI,Roboto,Helvetica,Arial,Noto Sans,Liberation Sans,sans-serif;
}
.topbar{
  display:flex; align-items:center; justify-content:space-between;
  gap:12px; padding:12px 16px; border-bottom:1px solid var(--border); background:var(--card);
  position:sticky; top:0; z-index:5;
}
.brand{font-weight:700}
.controls{display:flex; gap:12px; align-items:center}
.controls label{display:flex; gap:8px; align-items:center; color:var(--muted); font-size:14px}
.select select{background:var(--card); color:var(--fg); border:1px solid var(--border); padding:6px 8px; border-radius:8px}

.container{
  display:grid; gap:16px; padding:16px; max-width:1200px; margin:0 auto;
  grid-template-columns:1fr;
}
@media (min-width: 960px){ .container{ grid-template-columns:1fr 1fr; } }

.panel{
  background:var(--card); border:1px solid var(--border); border-radius:14px; padding:14px;
  display:flex; flex-direction:column; gap:12px;
}
.field{display:flex; flex-direction:column; gap:6px}
.field label{font-weight:600}
textarea{
  width:100%; resize:vertical; padding:12px; border-radius:10px; border:1px solid var(--border);
  background:var(--bg); color:var(--fg); font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,"Liberation Mono",monospace;
}
textarea:focus{outline:2px solid var(--focus)}
.actions{display:flex; gap:10px; flex-wrap:wrap}
.btn{
  appearance:none; border:1px solid var(--border); background:var(--btn); color:var(--btn-fg);
  padding:10px 14px; border-radius:10px; cursor:pointer;
}
.btn.primary{ background:var(--brand); color:var(--brand-fg); border-color:transparent; }
.btn.subtle{ opacity:.85 }
.btn:disabled{opacity:.6; cursor:not-allowed}
.status{color:var(--muted); font-size:14px; min-height:20px}
.footer{padding:24px; text-align:center; color:var(--muted)}

/* ====== PRESETS ====== */
.presets{display:flex; flex-direction:column; gap:10px}
.preset-bar{
  display:flex; align-items:center; justify-content:space-between; gap:12px;
}
.preset-controls{display:flex; align-items:center; gap:10px; flex-wrap:wrap}
.toggle{display:flex; align-items:center; gap:6px; color:var(--muted); font-size:14px}
.chips{
  display:flex; gap:8px; flex-wrap:wrap; overflow-x:auto; padding-bottom:4px;
}
.chip{
  border:1px solid var(--border); background:var(--btn); color:var(--btn-fg);
  padding:8px 10px; border-radius:999px; white-space:nowrap; cursor:pointer; font-size:14px;
}
.chip:hover{filter:brightness(0.97)}
