/* =========================================================================
   Uli AI — Modul Generator (uli.my.id/edu)
   Satu sistem desain untuk semua halaman /edu: Plus Jakarta Sans + Fraunces,
   teal / crimson / amber / slate, kartu putih di atas kertas hangat.
   ========================================================================= */

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --teal: #1a9e8c;      --teal-pale: #eef9f7;    --teal-light: #c4eae6;
  --teal-dark: #0d7a6a; --teal-deeper: #085747;
  --crimson: #c9405f;   --crimson-pale: #fdf0f3; --crimson-soft: #f5d5dd;
  --amber: #a5620c;     --amber-pale: #fdf4e7;   --amber-soft: #f9d89a;
  --slate: #4a6fa5;     --slate-pale: #edf2fa;   --slate-soft: #c4d4ef;
  --green: #0a6640;     --green-pale: #e8f8f0;

  --bg: #f5f4f1; --surface: #ffffff; --surface2: #f0ede8;
  --border: #e4e0d9; --border2: #ede9e3;

  --text: #171614; --text-2: #3a3733; --text-muted: #5f5a54;
  --text-light: #736d66; --text-dim: #8f8981;

  /* nada default kartu/panel; ditimpa .t-crimson / .t-amber / .t-slate */
  --accent: var(--teal-light); --tone: var(--teal); --tone-pale: var(--teal-pale);

  --nav-h: 62px; --r-card: 18px; --r-pill: 30px;
  --ease: cubic-bezier(.2, .7, .3, 1);
  --shadow: 0 1px 2px rgba(0, 0, 0, .03), 0 6px 20px rgba(0, 0, 0, .04);
}

html { scroll-behavior: smooth; scroll-padding-top: calc(var(--nav-h) + 16px); }
body {
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  background: var(--bg); color: var(--text);
  min-height: 100vh; line-height: 1.55; font-size: 15px;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
[hidden] { display: none !important; }
svg { flex-shrink: 0; }
:focus-visible { outline: 2px solid var(--teal); outline-offset: 3px; border-radius: 6px; }
.accent { font-style: italic; color: var(--teal); }
.req { color: var(--crimson); margin-left: 2px; }
.opt { color: var(--text-light); font-weight: 500; }
.ml-auto { margin-left: auto; }

/* ── NAV ── */
.nav {
  position: fixed; inset: 0 0 auto 0; height: var(--nav-h); z-index: 200;
  background: rgba(245, 244, 241, .93);
  backdrop-filter: blur(22px); -webkit-backdrop-filter: blur(22px);
  border-bottom: 1px solid var(--border);
}
.nav-inner {
  height: 100%; max-width: 1180px; margin: auto; padding: 0 24px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.nav-logo { display: flex; align-items: center; gap: 9px; text-decoration: none; }
.nav-logo img { width: 30px; height: 30px; object-fit: contain; border-radius: 8px; }
.nav-logo-name { font-family: 'Fraunces', serif; font-size: 18px; font-weight: 600; color: var(--text); letter-spacing: -.03em; }
.nav-logo-name em { font-style: italic; color: var(--teal); margin-left: 1px; }

.nav-links { display: flex; align-items: center; gap: 2px; }
.nav-link {
  display: flex; align-items: center; gap: 7px; min-height: 36px;
  padding: 6px 13px; border-radius: 8px;
  font-size: 13.5px; font-weight: 500; color: var(--text-muted);
  text-decoration: none; white-space: nowrap;
  transition: background .15s, color .15s;
}
.nav-link svg { width: 15px; height: 15px; opacity: .7; }
.nav-link:hover { background: var(--surface2); color: var(--text); }
.nav-link.active { background: var(--teal-pale); color: var(--teal-dark); font-weight: 600; }
.nav-link.active svg { opacity: 1; }

.nav-right { display: flex; align-items: center; gap: 8px; }
.nav-toggle {
  display: none; width: 40px; height: 40px; cursor: pointer;
  background: var(--surface2); border: 1px solid var(--border); border-radius: 10px;
  align-items: center; justify-content: center;
}
.ham { display: flex; flex-direction: column; gap: 4px; }
.ham span { display: block; width: 16px; height: 1.5px; background: var(--text-muted); border-radius: 2px; }
.nav-drawer {
  display: none; position: fixed; top: var(--nav-h); left: 0; right: 0; z-index: 198;
  background: var(--surface); border-bottom: 1px solid var(--border);
  padding: 8px 16px 16px; flex-direction: column; gap: 2px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .07);
}
.nav-drawer.open { display: flex; }
.nav-drawer .nav-link { font-size: 14.5px; padding: 11px 14px; min-height: 44px; }

/* menu akun */
.user-menu { position: relative; }
.user-chip {
  display: flex; align-items: center; gap: 8px; min-height: 40px;
  padding: 4px 12px 4px 4px; cursor: pointer; font: inherit;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-pill);
  transition: border-color .15s;
}
.user-chip:hover, .user-chip[aria-expanded="true"] { border-color: var(--teal-light); }
.user-chip img, .user-ava { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; }
.user-ava { display: flex; align-items: center; justify-content: center; flex-shrink: 0; background: var(--teal); color: #fff; font-weight: 700; font-size: 13px; }
.user-name { font-size: 13px; font-weight: 600; color: var(--text-2); max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-pop {
  position: absolute; right: 0; top: calc(100% + 8px); width: 250px; z-index: 210;
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, .1); padding: 6px;
}
.user-pop-head { padding: 10px; border-bottom: 1px solid var(--border2); margin-bottom: 4px; }
.user-pop-head strong { display: block; font-size: 13.5px; color: var(--text); }
.user-pop-head span { display: block; font-size: 12px; color: var(--text-light); overflow: hidden; text-overflow: ellipsis; }
.user-pop-item {
  display: flex; align-items: center; gap: 9px; width: 100%; min-height: 40px;
  padding: 8px 10px; border-radius: 9px; border: none; background: none; cursor: pointer;
  font: inherit; font-size: 13.5px; color: var(--text-2); text-decoration: none; text-align: left;
}
.user-pop-item svg { width: 16px; height: 16px; color: var(--text-light); }
.user-pop-item:hover { background: var(--surface2); }
.user-pop-item.danger:hover { background: var(--crimson-pale); color: var(--crimson); }
.user-pop-item.danger:hover svg { color: var(--crimson); }

/* ── TOMBOL ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 10px 22px; border-radius: var(--r-pill);
  background: var(--teal); color: #fff; border: 1px solid var(--teal);
  font: inherit; font-size: 14px; font-weight: 700; letter-spacing: .01em;
  text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: background .15s, transform .12s, box-shadow .15s, opacity .15s;
  box-shadow: 0 6px 16px rgba(26, 158, 140, .22);
}
.btn:hover { background: var(--teal-dark); border-color: var(--teal-dark); }
.btn:active { transform: scale(.98); }
.btn svg { width: 16px; height: 16px; }
.btn-sm { min-height: 38px; padding: 7px 16px; font-size: 13px; box-shadow: none; }
.btn-block { width: 100%; }
.btn-ghost { background: var(--surface); color: var(--text-2); border-color: var(--border); box-shadow: none; }
.btn-ghost:hover { background: var(--surface2); border-color: var(--border); }
.btn-danger { background: var(--surface); color: var(--crimson); border-color: var(--crimson-soft); box-shadow: none; }
.btn-danger:hover { background: var(--crimson-pale); border-color: var(--crimson); }
.btn[disabled] { opacity: .6; cursor: not-allowed; transform: none; }
.btn.is-busy svg { animation: spin 1.1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.back-btn {
  display: inline-flex; align-items: center; gap: 7px; min-height: 34px;
  padding: 5px 12px 5px 10px; margin-bottom: 10px; border-radius: var(--r-pill);
  background: var(--surface); border: 1px solid var(--border);
  font-size: 12.5px; font-weight: 600; color: var(--text-muted); text-decoration: none;
  transition: color .15s, border-color .15s, background .15s;
}
.back-btn svg { width: 14px; height: 14px; }
.back-btn:hover { color: var(--teal-dark); border-color: var(--teal-light); background: var(--teal-pale); }

/* ── HALAMAN ── */
.page { margin-top: var(--nav-h); padding: 28px 24px 56px; display: flex; flex-direction: column; align-items: center; }
.inner { max-width: 1180px; width: 100%; }
.inner.narrow { max-width: 760px; }

/* kepala halaman seragam */
.phead { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px 24px; flex-wrap: wrap; margin-bottom: 22px; }
.phead-main { min-width: 0; flex: 1 1 380px; }
.phead-title { font-family: 'Fraunces', serif; font-size: clamp(24px, 3.2vw, 30px); font-weight: 600; letter-spacing: -.03em; line-height: 1.15; }
.phead-sub { margin-top: 4px; font-size: 14px; color: var(--text-muted); line-height: 1.55; max-width: 640px; }
.phead-right { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

/* kartu akun ringkas */
.acct-mini {
  display: flex; align-items: center; gap: 10px; max-width: 360px;
  padding: 7px 8px 7px 7px; border-radius: 14px; text-decoration: none;
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow);
  transition: border-color .15s;
}
.acct-mini:hover { border-color: var(--teal-light); }
.acct-mini img, .acct-mini .user-ava { width: 36px; height: 36px; border-radius: 10px; object-fit: cover; }
.acct-mini-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.acct-mini-text strong { font-size: 13.5px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.acct-mini-text span { font-size: 12px; color: var(--text-light); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.acct-mini-cta { margin-left: 4px; padding: 4px 10px; border-radius: 8px; background: var(--teal-pale); color: var(--teal-dark); font-size: 12px; font-weight: 700; }
.acct-mini.is-todo { border-color: var(--amber-soft); background: var(--amber-pale); }
.acct-mini.is-todo .acct-mini-text span { color: var(--amber); font-weight: 600; }
.acct-mini.is-todo .acct-mini-cta { background: var(--amber); color: #fff; }

.kuota-chip {
  display: inline-flex; align-items: center; gap: 7px; padding: 7px 12px; border-radius: var(--r-pill);
  background: var(--surface); border: 1px solid var(--border); font-size: 12.5px; color: var(--text-muted);
}
.kuota-chip svg { width: 14px; height: 14px; color: var(--teal); }
.kuota-chip strong { color: var(--teal-dark); }

/* ── LABEL BAGIAN ── */
.section-label {
  font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  color: var(--text-light); margin-bottom: 12px;
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap; row-gap: 2px;
}
.section-label::after { content: ''; flex: 1; height: 1px; background: var(--border); }
.section-label small { font-size: 12px; font-weight: 500; letter-spacing: 0; text-transform: none; color: var(--text-light); }

/* ── GRID & KARTU ALAT ── */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 14px; margin-bottom: 30px; list-style: none; }
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-card);
  padding: 18px 18px 16px; display: flex; flex-direction: column; height: 100%;
  position: relative; overflow: hidden; text-decoration: none; color: inherit;
  transition: transform .2s var(--ease), box-shadow .2s var(--ease), border-color .2s;
}
.card::after {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  opacity: 0; transition: opacity .25s;
}
.card:hover { transform: translateY(-3px); border-color: var(--accent); box-shadow: 0 12px 30px rgba(0, 0, 0, .07); }
.card:hover::after { opacity: 1; }
.card:focus-visible { outline-offset: 3px; border-radius: var(--r-card); }
.t-crimson { --accent: var(--crimson-soft); --tone: var(--crimson); --tone-pale: var(--crimson-pale); }
.t-amber   { --accent: var(--amber-soft);   --tone: var(--amber);   --tone-pale: var(--amber-pale); }
.t-slate   { --accent: var(--slate-soft);   --tone: var(--slate);   --tone-pale: var(--slate-pale); }
.card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; margin-bottom: 12px; }

.icon-wrap {
  width: 42px; height: 42px; border-radius: 12px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: var(--tone-pale); color: var(--tone); border: 1px solid var(--accent);
  transition: transform .2s var(--ease);
}
.icon-wrap svg { width: 20px; height: 20px; }
.card:hover .icon-wrap { transform: scale(.94); }
.card-name { font-family: 'Fraunces', serif; font-size: 18px; font-weight: 600; letter-spacing: -.02em; margin-bottom: 5px; }
.card-desc { font-size: 13px; color: var(--text-muted); line-height: 1.6; flex: 1; margin-bottom: 12px; }
.card-cta { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; font-weight: 700; color: var(--tone); transition: gap .18s; }
.card-cta svg { width: 14px; height: 14px; transition: transform .18s; }
.card:hover .card-cta { gap: 8px; }
.card.is-lock { background: var(--surface2); --accent: var(--border); --tone: var(--text-light); --tone-pale: var(--surface); }
.card.is-lock:hover { transform: none; box-shadow: none; }
.card.is-lock .card-desc { color: var(--text-light); }

.pill {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 10.5px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase;
  padding: 3px 10px; border-radius: var(--r-pill);
  background: var(--tone-pale); color: var(--tone);
}
.pill svg { width: 11px; height: 11px; }
.pill-live { background: var(--green-pale); color: var(--green); }
.pill-soon { background: var(--surface2); color: var(--text-light); border: 1px solid var(--border); }
.pill-off  { background: var(--crimson-pale); color: var(--crimson); }

/* ── APA INI ── */
.about { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-card); padding: 24px; }
.about h2 { font-family: 'Fraunces', serif; font-size: 21px; font-weight: 600; letter-spacing: -.02em; margin-bottom: 6px; }
.about > p { color: var(--text-muted); font-size: 14px; line-height: 1.7; max-width: 680px; margin-bottom: 18px; }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; list-style: none; counter-reset: s; }
.steps li { counter-increment: s; background: var(--bg); border: 1px solid var(--border2); border-radius: 14px; padding: 14px; }
.steps li::before {
  content: counter(s); display: flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; border-radius: 50%; margin-bottom: 10px;
  background: var(--teal); color: #fff; font-size: 12.5px; font-weight: 700;
}
.steps strong { display: block; font-size: 14px; margin-bottom: 3px; }
.steps span { font-size: 13px; color: var(--text-muted); line-height: 1.55; }

/* ── PANEL & FORM ── */
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-card); padding: 22px; margin-bottom: 14px; }
.panel-head { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.panel-head .icon-wrap { width: 38px; height: 38px; border-radius: 11px; }
.panel-head .icon-wrap svg { width: 18px; height: 18px; }
.panel-head h2 { font-family: 'Fraunces', serif; font-size: 18px; font-weight: 600; letter-spacing: -.02em; }
.panel-head p { font-size: 12.5px; color: var(--text-muted); }

.fields { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 14px; }
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field.full { grid-column: 1 / -1; }
.field label { font-size: 12.5px; font-weight: 600; color: var(--text-2); }
.field input, .field select, .field textarea {
  width: 100%; min-height: 42px; padding: 9px 12px;
  background: var(--bg); border: 1px solid var(--border); border-radius: 11px;
  font: inherit; font-size: 14.5px; color: var(--text);
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.field textarea { min-height: 70px; resize: vertical; line-height: 1.5; }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; background: #fff; border-color: var(--teal); box-shadow: 0 0 0 3px rgba(26, 158, 140, .14);
}
.field input[readonly] { color: var(--text-muted); cursor: default; }
.field .hint { font-size: 11.5px; color: var(--text-light); line-height: 1.5; }
.field .err { font-size: 12px; color: var(--crimson); font-weight: 600; }
.field.has-err input, .field.has-err select, .field.has-err textarea { border-color: var(--crimson); background: var(--crimson-pale); }
fieldset.field { border: none; }
fieldset.field legend { font-size: 12.5px; font-weight: 600; color: var(--text-2); margin-bottom: 6px; }
.form-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: flex-end; margin-top: 6px; }

.chips { flex-direction: row; flex-wrap: wrap; gap: 6px; }
.chip-check { position: relative; cursor: pointer; }
.chip-check input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.chip-check span {
  display: inline-flex; align-items: center; min-height: 34px; padding: 6px 12px;
  border: 1px solid var(--border); border-radius: var(--r-pill); background: var(--bg);
  font-size: 12.5px; color: var(--text-2); transition: background .15s, border-color .15s, color .15s;
}
.chip-check input:checked + span { background: var(--teal-pale); border-color: var(--teal); color: var(--teal-deeper); font-weight: 600; }
.chip-check input:focus-visible + span { outline: 2px solid var(--teal); outline-offset: 2px; }
.field.has-err .chip-check span { border-color: var(--crimson); }

/* ── PEMBERITAHUAN ── */
.notice {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 11px 14px; border-radius: 12px; font-size: 13.5px; line-height: 1.55; margin-bottom: 16px;
  background: var(--teal-pale); color: var(--teal-deeper); border: 1px solid var(--teal-light);
}
.notice svg { width: 18px; height: 18px; margin-top: 1px; }
.notice.warn { background: var(--amber-pale); color: #6e4108; border-color: var(--amber-soft); }
.notice.err  { background: var(--crimson-pale); color: #8e2540; border-color: var(--crimson-soft); }

/* ── PRATINJAU TANDA TANGAN (profil) ── */
.ttd { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; background: var(--bg); border: 1px dashed var(--border); border-radius: 14px; padding: 18px; font-size: 13px; color: var(--text-2); }
.ttd div { line-height: 1.6; }
.ttd .sp { height: 42px; }
.ttd .nm { font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
.ttd .ph { color: var(--text-dim); font-weight: 500; font-style: italic; text-decoration: none; }

/* ── TOOL: form kiri, hasil kanan ── */
.tool { display: grid; grid-template-columns: 400px minmax(0, 1fr); gap: 22px; align-items: start; }
.tool-form { position: sticky; top: calc(var(--nav-h) + 14px); display: flex; flex-direction: column; gap: 12px; }
.tool-out { min-width: 0; }

.id-mini {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
}
.id-mini .user-ava { width: 32px; height: 32px; border-radius: 9px; }
.id-mini-text { display: flex; flex-direction: column; min-width: 0; flex: 1; line-height: 1.3; }
.id-mini-text strong { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.id-mini-text span { font-size: 11.5px; color: var(--text-light); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.id-mini a { font-size: 12px; font-weight: 700; color: var(--teal-dark); text-decoration: none; padding: 4px 8px; border-radius: 8px; }
.id-mini a:hover { background: var(--teal-pale); }

.fpanel { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 16px; }
.fpanel-title { font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--text-light); margin-bottom: 12px; }
.bentuk-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.bentuk-item { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 5px 5px 5px 11px; border: 1px solid var(--border); border-radius: 11px; background: var(--bg); font-size: 12.5px; font-weight: 600; color: var(--text-2); }
.bentuk-item input { width: 58px; min-height: 32px; padding: 4px 6px; text-align: center; border: 1px solid var(--border); border-radius: 8px; background: #fff; font: inherit; font-size: 14px; }
.bentuk-item input:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 3px rgba(26, 158, 140, .14); }
details.more summary {
  display: flex; align-items: center; justify-content: space-between; gap: 8px; cursor: pointer; list-style: none;
  font-size: 13px; font-weight: 600; color: var(--text-muted);
}
details.more summary::-webkit-details-marker { display: none; }
details.more summary svg { width: 14px; height: 14px; transition: transform .2s; transform: rotate(90deg); }
details.more[open] summary { margin-bottom: 12px; }
details.more[open] summary svg { transform: rotate(-90deg); }

/* keadaan kosong */
.out-empty {
  display: flex; flex-direction: column; align-items: center; text-align: center;
  padding: 56px 28px; min-height: 460px; justify-content: center;
  background: var(--surface); border: 1px dashed var(--border); border-radius: var(--r-card);
}
.out-empty h2 { font-family: 'Fraunces', serif; font-size: 21px; font-weight: 600; letter-spacing: -.02em; margin: 18px 0 6px; }
.out-empty p { max-width: 420px; font-size: 14px; color: var(--text-muted); line-height: 1.65; }
.out-empty-art { width: 120px; padding: 14px 12px; border-radius: 10px; background: var(--bg); border: 1px solid var(--border2); display: flex; flex-direction: column; gap: 7px; box-shadow: var(--shadow); }
.out-empty-art span { height: 6px; border-radius: 4px; background: var(--border); }
.out-empty-art span:first-child { width: 60%; margin: 0 auto 4px; background: var(--teal-light); }
.out-empty-art span:last-child { width: 70%; }
.out-feat { list-style: none; margin-top: 18px; display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--text-2); }
.out-feat li { display: flex; align-items: center; gap: 8px; }
.out-feat svg { width: 15px; height: 15px; color: var(--teal); }

/* proses (animasi) */
.gen {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-card);
  padding: 20px; margin-bottom: 14px; box-shadow: var(--shadow); position: relative; overflow: hidden;
}
.gen::before {
  content: ''; position: absolute; inset: 0 0 auto 0; height: 3px;
  background: linear-gradient(90deg, transparent, var(--teal), transparent); background-size: 50% 100%;
  background-repeat: no-repeat; animation: sweep 1.6s linear infinite;
}
@keyframes sweep { from { background-position: -50% 0; } to { background-position: 150% 0; } }
.gen.is-done::before, .gen.is-fail::before { display: none; }
.gen-head { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }
.gen-orb { position: relative; width: 46px; height: 46px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; border-radius: 50%; background: var(--teal-pale); }
.gen-orb::before {
  content: ''; position: absolute; inset: -3px; border-radius: 50%;
  background: conic-gradient(var(--teal) 0 25%, transparent 25% 100%);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 3px), #000 calc(100% - 3px));
  mask: radial-gradient(farthest-side, transparent calc(100% - 3px), #000 calc(100% - 3px));
  animation: spin 1s linear infinite;
}
.gen-orb img { width: 26px; height: 26px; object-fit: contain; animation: breathe 2.4s ease-in-out infinite; }
@keyframes breathe { 0%, 100% { transform: scale(1); } 50% { transform: scale(.88); } }
.gen.is-done .gen-orb::before, .gen.is-fail .gen-orb::before { animation: none; background: none; }
.gen.is-done .gen-orb { background: var(--teal); }
.gen.is-done .gen-orb img { filter: brightness(0) invert(1); animation: none; }
.gen.is-fail .gen-orb { background: var(--crimson-pale); }
.gen.is-fail .gen-orb img { animation: none; opacity: .6; }
.gen-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.gen-text strong { font-size: 15px; }
.gen-msg { font-size: 13px; color: var(--text-muted); }
.gen-msg.in { animation: msgIn .45s var(--ease); }
@keyframes msgIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.gen.is-fail .gen-msg { color: #8e2540; }
.gen-pct { font-family: 'Fraunces', serif; font-size: 26px; font-weight: 600; color: var(--teal-dark); font-variant-numeric: tabular-nums; }
.gen.is-fail .gen-pct { color: var(--crimson); }

.pbar { height: 12px; border-radius: 99px; background: var(--surface2); overflow: hidden; position: relative; }
.pbar-fill {
  height: 100%; width: 0; border-radius: 99px; position: relative;
  background-color: var(--teal);
  background-image: linear-gradient(45deg, rgba(255, 255, 255, .22) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .22) 50%, rgba(255, 255, 255, .22) 75%, transparent 75%, transparent);
  background-size: 22px 22px; animation: stripes .8s linear infinite;
  box-shadow: 0 0 14px rgba(26, 158, 140, .45); transition: width .35s var(--ease);
}
@keyframes stripes { from { background-position: 0 0; } to { background-position: 22px 0; } }
.gen.is-done .pbar-fill { animation: none; background-image: none; }
.gen.is-fail .pbar-fill { animation: none; background-color: var(--crimson); box-shadow: none; }

.gen-steps { list-style: none; display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 14px; }
.gen-steps li { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 11px; background: var(--bg); border: 1px solid var(--border2); font-size: 12.5px; color: var(--text-light); min-width: 0; }
.gs-lbl { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gs-ico { width: 22px; height: 22px; border-radius: 50%; flex-shrink: 0; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; background: var(--surface); border: 1px solid var(--border); }
.gs-run { color: var(--teal-deeper); background: var(--teal-pale); border-color: var(--teal-light); font-weight: 600; }
.gs-run .gs-ico { border: 2px solid var(--teal-light); border-top-color: var(--teal); color: transparent; animation: spin .8s linear infinite; }
.gs-done { color: var(--text-2); }
.gs-done .gs-ico { background: var(--teal); border-color: var(--teal); color: #fff; }
.gs-fail { color: #8e2540; background: var(--crimson-pale); border-color: var(--crimson-soft); }
.gs-fail .gs-ico { background: var(--crimson); border-color: var(--crimson); color: #fff; }
.gen-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 12px; font-size: 12.5px; color: var(--text-light); font-variant-numeric: tabular-nums; }

/* bilah dokumen */
.doc-bar {
  position: sticky; top: calc(var(--nav-h) + 8px); z-index: 50;
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin-bottom: 12px; padding: 8px 8px 8px 16px;
  background: rgba(255, 255, 255, .96); backdrop-filter: blur(8px);
  border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow);
}
.dl-parts { flex-basis: 100%; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; padding-top: 8px; border-top: 1px solid var(--border2); }
.dl-parts > span { font-size: 12px; font-weight: 600; color: var(--text-light); margin-right: 2px; }
.dl-parts .btn { min-height: 34px; padding: 5px 12px; font-size: 12.5px; }
.doc-bar-title { flex: 1; min-width: 160px; font-size: 13.5px; font-weight: 600; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* kertas A4 */
.paper-wrap { position: relative; }
.paper {
  background: #fff; color: #111;
  border: 1px solid var(--border); border-radius: 6px; box-shadow: 0 10px 40px rgba(0, 0, 0, .08);
  padding: 52px 56px; font-family: 'Times New Roman', Times, serif; font-size: 15px; line-height: 1.6;
  overflow-wrap: anywhere;
}
.paper:empty { display: none; }
.paper-skel { padding: 0 56px 40px; margin-top: -24px; background: #fff; border: 1px solid var(--border); border-top: none; border-radius: 0 0 6px 6px; display: flex; flex-direction: column; gap: 10px; }
.paper:empty + .paper-skel { margin-top: 0; border-top: 1px solid var(--border); border-radius: 6px; padding-top: 40px; }
.paper-skel i {
  display: block; height: 11px; border-radius: 6px; width: 100%;
  background: linear-gradient(90deg, var(--surface2) 0%, #faf8f5 50%, var(--surface2) 100%);
  background-size: 200% 100%; animation: shimmer 1.3s linear infinite;
}
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.kop { text-align: center; border-bottom: 3px double #111; padding-bottom: 10px; margin-bottom: 18px; }
.kop-nama { font-size: 19px; font-weight: 700; letter-spacing: .02em; }
.kop-sub { font-size: 13px; color: #333; }
.doc-judul { text-align: center; font-size: 19px; font-weight: 700; margin: 8px 0 2px; }
.doc-sub { text-align: center; margin: 0 0 16px; }
.paper h1 { font-size: 18px; text-align: center; margin: 14px 0 8px; }
.paper h2 { font-size: 16.5px; margin: 22px 0 8px; padding-bottom: 4px; border-bottom: 1.5px solid #111; }
.paper h3 { font-size: 15.5px; margin: 16px 0 6px; }
.paper h4 { font-size: 15px; font-style: italic; margin: 12px 0 4px; }
.paper p { margin: 0 0 8px; text-align: justify; }
.paper .doc-sub { text-align: center; margin-bottom: 16px; }
.paper ul, .paper ol { margin: 4px 0 10px 24px; }
.paper li { margin: 2px 0; }
.paper table { width: 100%; border-collapse: collapse; margin: 8px 0 12px; font-size: 14px; }
.paper th, .paper td { border: 1px solid #333; padding: 5px 8px; vertical-align: top; text-align: left; }
.paper th { background: #e6f4f1; }
.paper hr { border: none; border-top: 1px solid #999; margin: 14px 0; }
.paper li > p { margin-bottom: 4px; text-align: left; }
.paper .opsi { margin: 0 0 2px 4px; }
.paper .stimulus { padding: 8px 12px; background: #f6f6f4; border-left: 3px solid #999; font-style: italic; }
.paper .kartu { margin-bottom: 18px; page-break-inside: avoid; }
.paper .kartu th { text-align: center; }
.page-break { border-top: 2px dashed var(--border); margin: 36px -56px 30px; position: relative; }
.page-break::after { content: 'halaman baru'; position: absolute; left: 50%; top: -10px; transform: translateX(-50%); background: #fff; padding: 0 10px; font: 600 11px 'Plus Jakarta Sans', sans-serif; color: var(--text-dim); letter-spacing: .06em; text-transform: uppercase; }
.id-table td:first-child { width: 32%; font-weight: 700; }
.ttd-table { margin-top: 36px !important; page-break-inside: avoid; }
.ttd-table td { border: none !important; width: 50%; text-align: center; vertical-align: top; }
.ttd-table .sp { height: 64px; }

/* ── AUTH ── */
.auth-wrap { min-height: calc(100vh - var(--nav-h) - 200px); display: flex; align-items: center; justify-content: center; }
.auth {
  width: 100%; max-width: 440px; text-align: center;
  background: var(--surface); border: 1px solid var(--border); border-radius: 24px;
  padding: 34px 28px 28px; box-shadow: 0 24px 60px rgba(0, 0, 0, .06);
}
.auth-logo { width: 56px; height: 56px; object-fit: contain; margin: 0 auto 16px; display: block; }
.auth h1 { font-family: 'Fraunces', serif; font-size: 24px; font-weight: 600; letter-spacing: -.02em; margin-bottom: 8px; }
.auth > p { color: var(--text-muted); font-size: 14px; line-height: 1.65; margin-bottom: 22px; }
.gbtn { display: flex; justify-content: center; min-height: 44px; margin-bottom: 14px; }
.auth-status { font-size: 13px; min-height: 20px; color: var(--text-muted); }
.auth-status.err { color: var(--crimson); font-weight: 600; }
.auth-note { text-align: left; margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--border2); font-size: 12.5px; color: var(--text-light); line-height: 1.6; }
.auth-note li { margin: 0 0 4px 18px; }

/* ── HALAMAN ALAT: segera / kode ── */
.soon { text-align: center; padding: 34px 26px; }
.soon .icon-wrap { width: 60px; height: 60px; border-radius: 18px; margin: 0 auto 16px; }
.soon .icon-wrap svg { width: 26px; height: 26px; }
.soon h1 { font-family: 'Fraunces', serif; font-size: 26px; font-weight: 600; letter-spacing: -.02em; margin-bottom: 8px; }
.soon p { color: var(--text-muted); font-size: 14.5px; line-height: 1.7; max-width: 520px; margin: 0 auto 20px; }
.soon dl { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; text-align: left; max-width: 440px; margin: 0 auto 24px; background: var(--bg); border: 1px solid var(--border2); border-radius: 14px; padding: 14px 16px; font-size: 13.5px; }
.soon dt { color: var(--text-light); }
.soon dd { color: var(--text); font-weight: 600; }
.kode-form { max-width: 360px; margin: 0 auto 8px; display: flex; flex-direction: column; gap: 12px; text-align: left; }
.kode-form input { text-transform: uppercase; letter-spacing: .12em; font-weight: 600; text-align: center; }
.kode-form input::placeholder { letter-spacing: .12em; }

/* ── ADMIN (manage) ── */
.mtabs { display: flex; gap: 4px; padding: 4px; background: var(--surface2); border: 1px solid var(--border); border-radius: 14px; margin-bottom: 18px; overflow-x: auto; }
.mtab { display: inline-flex; align-items: center; gap: 7px; min-height: 40px; padding: 8px 16px; border-radius: 10px; font-size: 13.5px; font-weight: 600; color: var(--text-muted); text-decoration: none; white-space: nowrap; }
.mtab svg { width: 15px; height: 15px; }
.mtab:hover { color: var(--text); }
.mtab[aria-current="page"] { background: var(--surface); color: var(--teal-dark); box-shadow: 0 2px 8px rgba(0, 0, 0, .06); }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 18px; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 14px 16px; }
.stat span { display: block; font-size: 12px; color: var(--text-light); font-weight: 600; }
.stat strong { display: block; font-family: 'Fraunces', serif; font-size: 28px; font-weight: 600; color: var(--text); line-height: 1.2; font-variant-numeric: tabular-nums; }
.stat small { font-size: 12px; color: var(--text-muted); }
.mgrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.mgrid .panel { margin: 0; }
.panel-title { font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--text-light); margin-bottom: 10px; display: flex; justify-content: space-between; gap: 8px; }
.tbl-wrap { overflow-x: auto; margin: 0 -4px; }
.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th { text-align: left; font-size: 11.5px; font-weight: 700; color: var(--text-light); padding: 8px 8px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.tbl td { padding: 9px 8px; border-bottom: 1px solid var(--border2); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: none; }
.tbl tbody tr:hover td { background: var(--bg); }
.tbl .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tbl .muted { color: var(--text-light); font-size: 12px; }
.tbl .nowrap { white-space: nowrap; }
.tbl .acts { display: flex; gap: 6px; justify-content: flex-end; }
.tbl .acts form { display: inline; }
.meter { display: flex; align-items: center; gap: 8px; }
.meter i { display: block; height: 7px; border-radius: 4px; background: var(--teal-light); min-width: 3px; }
.meter b { font-weight: 600; font-variant-numeric: tabular-nums; font-size: 12.5px; }
.bars { display: flex; align-items: flex-end; gap: 6px; height: 140px; padding-top: 10px; }
.bar { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 4px; height: 100%; min-width: 0; }
.bar i { display: block; width: 100%; max-width: 30px; border-radius: 6px 6px 3px 3px; background: linear-gradient(180deg, var(--teal), var(--teal-light)); min-height: 3px; }
.bar b { font-size: 11px; font-weight: 700; color: var(--text-2); }
.bar span { font-size: 10.5px; color: var(--text-light); white-space: nowrap; }
.mono { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12.5px; }
.badge { display: inline-flex; align-items: center; padding: 2px 8px; border-radius: 6px; font-size: 11px; font-weight: 700; }
.badge-ok { background: var(--green-pale); color: var(--green); }
.badge-off { background: var(--surface2); color: var(--text-light); }
.badge-warn { background: var(--crimson-pale); color: var(--crimson); }
.badge-admin { background: var(--slate-pale); color: var(--slate); }
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
.toolbar input[type="search"] { flex: 1; min-width: 200px; min-height: 40px; padding: 8px 12px; border: 1px solid var(--border); border-radius: 11px; background: var(--surface); font: inherit; font-size: 14px; }
.toolbar input[type="search"]:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 3px rgba(26, 158, 140, .14); }
.inline-form { display: grid; grid-template-columns: 1fr 2fr auto; gap: 10px; align-items: end; }

/* ── FOOTER ── */
.footer { margin-top: 40px; text-align: center; border-top: 1px solid var(--border2); padding-top: 22px; }
.footer-inner { display: flex; align-items: center; justify-content: center; gap: 10px; flex-wrap: wrap; }
.footer img { width: 22px; height: 22px; border-radius: 6px; object-fit: contain; opacity: .65; }
.footer-copy { font-size: 12.5px; color: var(--text-light); }
.footer-copy strong { color: var(--text-muted); }
.heart { color: var(--crimson); }
.footer-links { display: flex; justify-content: center; gap: 4px 16px; flex-wrap: wrap; margin-top: 10px; }
.footer-links a { font-size: 12.5px; color: var(--text-muted); text-decoration: none; padding: 4px 2px; }
.footer-links a:hover { color: var(--teal-dark); text-decoration: underline; }

/* ── HALAMAN TEKS (privasi, ketentuan, tentang) ── */
.legal { padding: 28px 30px; font-size: 15px; line-height: 1.75; color: var(--text-2); }
.legal h2 { font-family: 'Fraunces', serif; font-size: 19px; font-weight: 600; letter-spacing: -.01em; color: var(--text); margin: 26px 0 8px; }
.legal h3 { font-size: 15px; font-weight: 700; color: var(--text); margin: 14px 0 4px; }
.legal p { margin-bottom: 10px; }
.legal ul, .legal ol { margin: 4px 0 12px 22px; }
.legal li { margin: 4px 0; }
.legal a { color: var(--teal-dark); font-weight: 600; }
.legal code { font-size: 13px; background: var(--surface2); padding: 1px 6px; border-radius: 5px; }
.danger-zone summary { color: var(--crimson); }
.danger-zone .hint-text { font-size: 13.5px; color: var(--text-muted); margin-bottom: 12px; line-height: 1.6; }
.danger-zone .field { max-width: 300px; }
.consent { margin-top: 12px; font-size: 12.5px; color: var(--text-light); line-height: 1.6; }
.consent a { color: var(--teal-dark); font-weight: 600; }

/* ── GERAK ── */
@keyframes fadeUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.phead, .section-label, .grid > li, .panel, .auth, .about, .fpanel, .id-mini, .out-empty, .stat { animation: fadeUp .4s var(--ease) both; }
.grid > li:nth-child(2) { animation-delay: .05s; }
.grid > li:nth-child(3) { animation-delay: .1s; }
.grid > li:nth-child(n+4) { animation-delay: .15s; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* ── RESPONSIF ── */
@media (max-width: 980px) {
  .tool { grid-template-columns: 1fr; }
  .tool-form { position: static; }
  .out-empty { min-height: 0; padding: 36px 22px; }
  .mgrid { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .nav-links { display: none; }
  .nav-toggle { display: flex; }
  .user-name { display: none; }
  .user-chip { padding: 4px; }
  .nav-inner { padding: 0 16px; }
  .page { padding: 20px 16px 44px; }
  .grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .card { padding: 16px 14px 14px; }
  .card-name { font-size: 16px; }
  .steps { grid-template-columns: 1fr; }
  .fields { grid-template-columns: 1fr 1fr; }
  .panel, .about { padding: 18px 16px; }
  .ttd { grid-template-columns: 1fr; gap: 18px; }
  .gen-steps { grid-template-columns: 1fr; }
  .paper { padding: 28px 20px; font-size: 14px; }
  .paper-skel { padding: 0 20px 28px; }
  .acct-mini { max-width: none; width: 100%; }
  .inline-form { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  .grid { grid-template-columns: 1fr; }
  .fields { grid-template-columns: 1fr; }
  .auth { padding: 28px 18px 22px; }
  .form-actions .btn { width: 100%; }
  .doc-bar-title { flex-basis: 100%; }
}

/* ── CETAK: hanya dokumen ── */
@media print {
  @page { size: A4; margin: 2cm; }
  body { background: #fff; }
  body * { visibility: hidden; }
  .paper, .paper * { visibility: visible; }
  .paper { position: absolute; left: 0; top: 0; width: 100%; max-width: none; margin: 0; padding: 0; border: none; box-shadow: none; font-size: 12pt; }
  .paper-skel { display: none !important; }
  .page-break { border: none; margin: 0; page-break-before: always; }
  .page-break::after { display: none; }
  .paper h2 { page-break-after: avoid; }
  .paper tr { page-break-inside: avoid; }
}
