:root {
  --bg: #f4f7fb;
  --card: #ffffff;
  --text: #1f2937;
  --muted: #5b6473;
  --brand: #1f3a8a;
  --accent: #0f766e;
  --danger: #b91c1c;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: Inter, Segoe UI, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
}
.topbar {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
  padding: 1rem 1.25rem;
  background: #0f172a;
  color: #fff;
}
.topbar a { color: #c7d2fe; text-decoration: none; margin-left: 0.8rem; }
main, section { width: min(1100px, 94%); margin: 1rem auto; }
.card {
  background: var(--card);
  border-radius: 14px;
  border: 1px solid #dbe2ec;
  padding: 1rem;
  box-shadow: 0 6px 20px rgba(15, 23, 42, 0.06);
}
.modules {
  width: min(1100px, 94%);
  margin: 1rem auto 2rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
  gap: 0.9rem;
}
.actions { display: flex; gap: 0.7rem; flex-wrap: wrap; margin-top: 0.8rem; }
button, .button {
  border: none;
  background: var(--brand);
  color: #fff;
  text-decoration: none;
  border-radius: 9px;
  padding: 0.55rem 0.9rem;
  cursor: pointer;
}
button:hover, .button:hover { opacity: 0.9; }
.danger { background: var(--danger); }
.disabled { pointer-events: none; opacity: 0.45; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit,minmax(220px,1fr)); gap: 0.8rem; }
label { display: grid; gap: 0.35rem; font-weight: 600; }
input, textarea {
  border: 1px solid #c7d2e2;
  border-radius: 8px;
  padding: 0.55rem;
  font: inherit;
}
textarea { width: 100%; }
.meter { background: #dbe2ec; height: 12px; border-radius: 99px; overflow: hidden; }
.meter span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--brand), var(--accent)); }
.editor-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(250px,1fr)); gap: 0.8rem; }
.editor-grid textarea { min-height: 220px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
#preview { width: 100%; min-height: 260px; border: 1px solid #dbe2ec; border-radius: 8px; margin-top: 0.8rem; background: #fff; }
.hidden { display: none; }
.error { color: var(--danger); }
.success { color: #047857; }
.certificate { text-align: center; padding: 2rem 1rem; border: 2px dashed #1f3a8a; }
@media (max-width: 700px) {
  .topbar { flex-direction: column; align-items: flex-start; }
}
