/* ==========================================================================
   Modul Ajar MI — stylesheet
   Palet: hijau madrasah, krem kertas, aksen emas.
   ========================================================================== */

:root {
  --ink: #14251c;
  --ink-2: #2c3f34;
  --muted: #5d6f63;
  --muted-2: #7d8c82;
  --line: #e2e8e1;
  --line-2: #eef2ec;
  --bg: #f4f7f2;
  --card: #ffffff;
  --green-900: #103d24;
  --green-800: #14532d;
  --green-700: #15803d;
  --green-600: #16a34a;
  --green-50: #eef7f0;
  --green-100: #dcf0e2;
  --gold: #b8912f;
  --gold-50: #fbf5e4;
  --sand: #faf8f1;
  --danger: #b91c1c;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow-sm: 0 1px 2px rgba(20, 37, 28, .06), 0 1px 3px rgba(20, 37, 28, .04);
  --shadow: 0 10px 30px -12px rgba(16, 61, 36, .22), 0 2px 6px rgba(16, 61, 36, .05);
  --font: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --serif: "Times New Roman", Times, Georgia, serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  font-family: var(--font);
  color: var(--ink);
  background:
    radial-gradient(1200px 500px at 80% -10%, #eaf3e6 0%, rgba(234, 243, 230, 0) 60%),
    radial-gradient(900px 400px at -10% 10%, #f6f0dd 0%, rgba(246, 240, 221, 0) 55%),
    var(--bg);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  line-height: 1.55;
}
h1, h2, h3, h4 { margin: 0; line-height: 1.25; letter-spacing: -.01em; }
p { margin: 0; }
svg { width: 1em; height: 1em; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.wrap { width: 100%; max-width: 1400px; margin: 0 auto; padding: 0 24px; }
.wrap-narrow { max-width: 1000px; }
::selection { background: #cfe9d6; }

/* ------------------------------------------------------------------ header */
.site-header {
  position: sticky; top: 0; z-index: 60;
  background: rgba(255, 255, 255, .88);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; gap: 24px; height: 68px; }
.brand { display: flex; align-items: center; gap: 11px; text-decoration: none; color: inherit; flex-shrink: 0; }
.brand-mark {
  width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; overflow: hidden;
  background: #fff; border: 1px solid #e4ebdf; padding: 2px;
  box-shadow: 0 3px 10px -4px rgba(16, 61, 36, .35);
}
.brand-mark img { width: 100%; height: 100%; object-fit: contain; display: block; }
.brand-mark svg { width: 22px; height: 22px; stroke-width: 1.6; }
.brand-mark--sm { width: 34px; height: 34px; border-radius: 10px; }
.brand-mark--sm svg { width: 18px; height: 18px; }
.brand-text strong { display: block; font-size: 16px; font-weight: 800; letter-spacing: -.02em; }
.brand-text small { display: block; font-size: 11px; color: var(--muted); font-weight: 500; letter-spacing: .01em; }

.site-nav { display: flex; align-items: center; gap: 4px; margin-left: 8px; }
.nav-link {
  position: relative; border: 0; background: none; font: inherit; font-size: 14px; font-weight: 600;
  color: var(--ink-2); padding: 8px 12px; border-radius: 9px; cursor: pointer; display: inline-flex; align-items: center; gap: 7px;
  transition: background .15s, color .15s;
}
.nav-link:hover { background: var(--green-50); color: var(--green-800); }
.nav-link.is-active { color: var(--green-800); }
.nav-link.is-active::after {
  content: ""; position: absolute; left: 12px; right: 12px; bottom: -19px; height: 2px; background: var(--green-700); border-radius: 2px;
}
.pill {
  font-size: 11px; font-weight: 700; background: var(--green-100); color: var(--green-800);
  border-radius: 999px; padding: 1px 7px; min-width: 20px; text-align: center;
}
.header-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.mobile-nav { display: none; border-top: 1px solid var(--line); padding: 8px 16px 12px; flex-direction: column; gap: 2px; background: #fff; }
.mobile-nav .nav-link { justify-content: flex-start; padding: 10px 8px; }
.mobile-nav .nav-link.is-active::after { display: none; }

/* ------------------------------------------------------------------ button */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: inherit; font-size: 13.5px; font-weight: 700; letter-spacing: .01em;
  padding: 10px 16px; border-radius: 11px; border: 1px solid transparent; cursor: pointer;
  transition: background .16s, border-color .16s, color .16s, box-shadow .16s, transform .06s;
  white-space: nowrap; text-decoration: none;
}
.btn:active { transform: translateY(1px); }
.btn svg { width: 16px; height: 16px; }
.btn-primary { background: linear-gradient(180deg, #17853f, var(--green-800)); color: #fff; box-shadow: 0 1px 0 rgba(255, 255, 255, .12) inset, 0 6px 16px -8px rgba(16, 61, 36, .6); }
.btn-primary:hover { background: linear-gradient(180deg, #199046, #12502c); }
.btn-soft { background: var(--green-50); color: var(--green-800); border-color: #d6e9da; }
.btn-soft:hover { background: #e4f2e7; border-color: #bfdcc6; }
.btn-ghost { background: #fff; color: var(--ink-2); border-color: var(--line); }
.btn-ghost:hover { border-color: #cdd8cf; background: #fbfcfb; }
.btn-quiet { background: transparent; color: var(--muted); border-color: transparent; }
.btn-quiet:hover { background: #f0f3ef; color: var(--ink); }
.btn-sm { padding: 7px 12px; font-size: 12.5px; border-radius: 9px; }
.btn-block { width: 100%; padding: 13px 18px; font-size: 14.5px; }
.btn:disabled { opacity: .45; cursor: not-allowed; box-shadow: none; }
.btn:focus-visible, .nav-link:focus-visible, .icon-btn:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, .chip:focus-visible {
  outline: 2px solid var(--green-600); outline-offset: 2px;
}
.icon-btn {
  display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 10px;
  border: 1px solid var(--line); background: #fff; color: var(--ink-2); cursor: pointer;
}
.icon-btn:hover { background: #f7faf7; }
.icon-btn svg { width: 17px; height: 17px; }

/* -------------------------------------------------------------------- hero */
.hero {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 32px;
  padding: 34px 4px 26px; flex-wrap: wrap;
}
.hero-main { max-width: 780px; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 7px; font-size: 11.5px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .1em; color: var(--green-700); margin-bottom: 12px;
}
.eyebrow svg { width: 14px; height: 14px; }
.hero h1 { font-size: clamp(26px, 3vw, 38px); font-weight: 800; letter-spacing: -.03em; color: var(--green-900); }
.hero h1 em { font-style: normal; color: var(--green-700); }
.hero-sub { margin-top: 12px; font-size: 15px; color: var(--muted); max-width: 660px; }
.hero-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.tag {
  display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600;
  background: #fff; border: 1px solid var(--line); color: var(--ink-2); padding: 5px 11px; border-radius: 999px;
}
.tag svg { width: 13px; height: 13px; color: var(--green-700); }
.hero-stats { display: flex; gap: 10px; }
.stat {
  background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 12px 16px; min-width: 92px;
  box-shadow: var(--shadow-sm);
}
.stat strong { display: block; font-size: 24px; font-weight: 800; color: var(--green-800); line-height: 1; }
.stat span { display: block; margin-top: 6px; font-size: 11px; line-height: 1.35; color: var(--muted); font-weight: 600; }

/* --------------------------------------------------------------- workbench */
.workbench { display: grid; grid-template-columns: minmax(360px, 440px) minmax(0, 1fr); gap: 20px; align-items: start; padding-bottom: 48px; }
body.has-doc .hero { display: none; }
body.has-doc .workbench { padding-top: 24px; }
.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.form-panel { padding: 20px; }
.panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding-bottom: 14px; border-bottom: 1px solid var(--line-2); }
.panel-head h2 { font-size: 17px; font-weight: 800; letter-spacing: -.02em; }
.panel-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }

/* ---------------------------------------------------------------- presets */
.quick-presets { padding: 14px 0 4px; }
.field-label { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; color: var(--ink-2); margin-bottom: 6px; letter-spacing: .01em; }
.field-label b { color: var(--green-700); }
.field-label em { font-style: normal; font-weight: 500; color: var(--muted-2); font-size: 11px; }
.hint-inline { font-style: normal; font-weight: 600; color: var(--green-700); background: var(--green-50); border-radius: 999px; padding: 1px 8px; font-size: 10.5px; margin-left: auto; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  font: inherit; font-size: 12px; font-weight: 600; color: var(--ink-2); background: #fff;
  border: 1px solid var(--line); border-radius: 999px; padding: 6px 11px; cursor: pointer;
  transition: all .14s; display: inline-flex; align-items: center; gap: 6px;
}
.chip:hover { border-color: #bcd3c0; background: var(--green-50); }
.chip.is-active { background: var(--green-800); border-color: var(--green-800); color: #fff; }
.chip.is-active:hover { background: var(--green-900); }
.chips-preset .chip { font-size: 11.5px; }
.chips-time { margin-top: 8px; }
.chips-time .chip { font-size: 11px; padding: 4px 9px; }

/* --------------------------------------------------------------- accordion */
.acc { border-top: 1px solid var(--line-2); }
.acc summary {
  list-style: none; cursor: pointer; display: flex; align-items: center; gap: 10px;
  padding: 14px 2px; font-size: 13.5px; font-weight: 700; color: var(--ink); user-select: none;
}
.acc summary::-webkit-details-marker { display: none; }
.acc-ico { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; background: var(--green-50); color: var(--green-700); flex-shrink: 0; }
.acc-ico svg { width: 15px; height: 15px; }
.acc-chev { margin-left: auto; width: 16px; height: 16px; color: var(--muted-2); transition: transform .2s; }
.acc[open] .acc-chev { transform: rotate(180deg); }
.acc-body { padding: 2px 2px 16px; display: flex; flex-direction: column; gap: 12px; }
.acc-note { font-size: 11.5px; color: var(--muted); background: var(--sand); border: 1px dashed #e4dcc4; border-radius: 8px; padding: 8px 10px; }

/* ----------------------------------------------------------------- fields */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }
.span-2 { grid-column: span 2; }
.field { display: flex; flex-direction: column; min-width: 0; }
input[type="text"], input[type="search"], textarea, select {
  font: inherit; font-size: 13px; color: var(--ink); background: #fff;
  border: 1px solid var(--line); border-radius: 10px; padding: 9px 11px; width: 100%;
  transition: border-color .15s, box-shadow .15s; resize: vertical;
}
input::placeholder, textarea::placeholder { color: #a9b4ac; }
input:hover, textarea:hover, select:hover { border-color: #cbd7cd; }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--green-600); box-shadow: 0 0 0 3px rgba(22, 163, 74, .12); }
textarea { line-height: 1.5; min-height: 38px; }
select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%235d6f63' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; padding-right: 30px; }
.field-tools { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 6px; }
.counter { font-size: 11px; color: var(--muted-2); }
.cp-source { font-size: 11px; line-height: 1.45; color: var(--muted); background: var(--sand); border: 1px dashed #e6dfc9; border-radius: 8px; padding: 7px 9px; margin-top: 4px; }
.cp-source strong { font-weight: 700; color: var(--ink-2); }

/* logo madrasah */
.logo-row { display: flex; align-items: center; gap: 14px; background: #fbfcfa; border: 1px dashed #dfe7dd; border-radius: 12px; padding: 10px 12px; }
.logo-preview {
  width: 62px; height: 62px; flex-shrink: 0; border-radius: 12px; background: #fff;
  border: 1px solid var(--line); display: grid; place-items: center; overflow: hidden; padding: 3px;
}
.logo-preview img { max-width: 100%; max-height: 100%; object-fit: contain; display: block; }
.logo-actions { min-width: 0; }
.logo-btns { display: flex; flex-wrap: wrap; gap: 6px; }
.logo-hint { font-size: 11px; color: var(--muted-2); margin-top: 6px; line-height: 1.4; }

/* segmented */
.segmented { display: flex; background: #f1f4f0; border-radius: 10px; padding: 3px; gap: 3px; }
.segmented button {
  flex: 1; font: inherit; font-size: 12.5px; font-weight: 600; color: var(--ink-2);
  background: transparent; border: 0; border-radius: 8px; padding: 7px 8px; cursor: pointer; transition: all .15s;
}
.segmented button:hover { color: var(--green-800); }
.segmented button.is-active { background: #fff; color: var(--green-800); box-shadow: 0 1px 2px rgba(16, 61, 36, .12); }
.segmented-6 button { font-size: 12.5px; }
.segmented-6 button small { display: block; font-size: 9px; font-weight: 500; color: var(--muted-2); }

/* model cards */
.model-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
.model-card {
  text-align: left; border: 1px solid var(--line); background: #fff; border-radius: 11px; padding: 10px;
  cursor: pointer; font: inherit; transition: all .15s; display: flex; flex-direction: column; gap: 3px;
}
.model-card:hover { border-color: #bcd3c0; background: #fbfdfb; }
.model-card.is-active { border-color: var(--green-600); background: var(--green-50); box-shadow: 0 0 0 1px var(--green-600) inset; }
.model-card strong { font-size: 12.5px; font-weight: 700; color: var(--ink); }
.model-card span { font-size: 10.5px; color: var(--muted); line-height: 1.35; }

/* checklist */
.checklist { display: flex; flex-direction: column; gap: 2px; }
.check {
  display: flex; align-items: flex-start; gap: 9px; padding: 7px 8px; border-radius: 8px; cursor: pointer;
  font-size: 12.5px; color: var(--ink-2); transition: background .14s;
}
.check:hover { background: #f7faf7; }
.check input { margin: 2px 0 0; accent-color: var(--green-700); width: 15px; height: 15px; flex-shrink: 0; }
.check span { line-height: 1.4; }
.check.is-checked span { color: var(--green-900); font-weight: 600; }

/* form actions */
.form-actions { padding-top: 16px; border-top: 1px solid var(--line-2); margin-top: 4px; display: flex; flex-direction: column; gap: 10px; }
.form-hint { font-size: 11.5px; color: var(--muted); }

/* ----------------------------------------------------------------- preview */
.preview-panel { position: sticky; top: 84px; display: flex; flex-direction: column; max-height: calc(100vh - 104px); overflow: hidden; }
.preview-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; padding: 14px 16px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.preview-title { min-width: 0; }
.preview-badge { font-size: 10px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--green-700); background: var(--green-50); padding: 2px 8px; border-radius: 999px; }
.preview-title h2 { font-size: 15px; font-weight: 800; margin-top: 6px; letter-spacing: -.01em; }
.preview-title p { font-size: 12px; color: var(--muted); margin-top: 2px; }
.preview-actions { display: flex; align-items: center; gap: 6px; }
.preview-body { flex: 1; overflow: auto; padding: 18px; background: #eef1ea; }

.empty-state { text-align: center; padding: 48px 24px; max-width: 560px; margin: 0 auto; }
.empty-ico { width: 52px; height: 52px; border-radius: 14px; background: #fff; border: 1px solid var(--line); display: grid; place-items: center; margin: 0 auto 14px; color: var(--green-700); }
.empty-ico svg { width: 24px; height: 24px; }
.empty-state h3 { font-size: 17px; font-weight: 800; }
.empty-state > p { font-size: 13px; color: var(--muted); margin-top: 8px; }
.empty-state .btn { margin-top: 16px; }
.empty-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 20px 0; text-align: left; }
.empty-grid div { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 10px; }
.empty-grid strong { display: block; font-size: 11.5px; font-weight: 700; }
.empty-grid span { display: block; font-size: 10.5px; color: var(--muted); margin-top: 3px; line-height: 1.4; }
.empty-state--page { background: #fff; border: 1px dashed var(--line); border-radius: var(--radius); padding: 56px 24px; }

/* ------------------------------------------------------------------- sheet */
.sheet {
  width: 100%; max-width: 820px; margin: 0 auto; background: #fff; color: #111;
  padding: 56px 60px 64px; box-shadow: 0 8px 24px -8px rgba(16, 61, 36, .25), 0 1px 2px rgba(0, 0, 0, .06);
  border-radius: 3px; font-family: var(--serif); font-size: 13.2px; line-height: 1.55;
  overflow-wrap: break-word;
}
.sheet .doc-kop { display: flex; align-items: center; gap: 16px; border-bottom: 3px double #111; padding-bottom: 9px; margin-bottom: 18px; }
.sheet .doc-kop__logo { width: 66px; height: 66px; object-fit: contain; flex-shrink: 0; }
.sheet .doc-kop__text { flex: 1; text-align: center; min-width: 0; }
.sheet .doc-kop__kemenag { font-size: 11.5px; letter-spacing: .3px; }
.sheet .doc-kop__madrasah { font-size: 19px; font-weight: 700; margin-top: 2px; text-transform: uppercase; }
.sheet .doc-kop__alamat, .sheet .doc-kop__npsn { font-size: 10.5px; }
.sheet .doc-title { text-align: center; margin: 12px 0 18px; }
.sheet .doc-title h1 { font-family: var(--serif); font-size: 17px; letter-spacing: 1.5px; }
.sheet .doc-title__sub { font-size: 12.5px; margin-top: 3px; }
.sheet .doc-title__ket { font-size: 11px; font-style: italic; color: #333; }
.sheet h2.doc-h2 { font-family: var(--serif); font-size: 13.5px; margin: 22px 0 8px; border-bottom: 1px solid #333; padding-bottom: 3px; }
.sheet h3.doc-h3 { font-family: var(--serif); font-size: 13px; margin: 16px 0 6px; }
.sheet h4.doc-h4 { font-family: var(--serif); font-size: 12.5px; margin: 12px 0 5px; font-style: italic; }
.sheet .doc-p { margin: 5px 0 7px; text-align: justify; }
.sheet .doc-ul, .sheet .doc-ol { margin: 5px 0 9px; padding-left: 22px; }
.sheet li { margin: 2px 0; }
.sheet table { width: 100%; border-collapse: collapse; margin: 7px 0 11px; }
.sheet th, .sheet td { border: 1px solid #666; padding: 5px 7px; vertical-align: top; font-size: 11.5px; text-align: left; }
.sheet thead th { background: #efefef; font-weight: 700; }
.sheet table.doc-kv th { width: 24%; background: #f6f6f6; font-weight: 600; }
.sheet .doc-steps__tahap { font-weight: 700; }
.sheet .doc-break { border-top: 1px dashed #d5d9d2; margin: 22px 0; }
.sheet .doc-sign { margin-top: 34px; page-break-inside: avoid; }
.sheet .doc-sign__place { text-align: right; margin-right: 6%; }
.sheet .doc-sign__grid { display: flex; justify-content: space-between; margin-top: 8px; text-align: center; }
.sheet .doc-sign__col { width: 44%; }
.sheet .doc-sign__space { height: 62px; }
.sheet .doc-sign__name { font-weight: 700; text-decoration: underline; }
.sheet .doc-sign__nip { font-size: 11.5px; }
.sheet .doc-qr { margin-top: 20px; text-align: center; }
.sheet .doc-qr__img { width: 34mm; height: 34mm; display: block; margin: 0 auto 6px; }
.sheet .doc-qr__caption { margin: 0; font-size: 10.5px; color: #333; }
.sheet .doc-qr__text { margin: 0; font-size: 10.5px; white-space: pre-line; }

/* ------------------------------------------------------------------ contoh */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; padding: 36px 0 22px; flex-wrap: wrap; }
.page-head h1 { font-size: clamp(24px, 2.4vw, 32px); font-weight: 800; letter-spacing: -.03em; color: var(--green-900); }
.page-sub { font-size: 14px; color: var(--muted); margin-top: 8px; max-width: 640px; }
.search input { width: 260px; border-radius: 999px; padding: 10px 16px; font-size: 13px; }
.chips-filter { padding-bottom: 18px; }

.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; padding-bottom: 56px; }
.modul-card {
  background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 16px; display: flex; flex-direction: column;
  gap: 10px; transition: transform .16s, box-shadow .16s, border-color .16s; box-shadow: var(--shadow-sm);
}
.modul-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: #cfe0d2; }
.card-top { display: flex; align-items: center; gap: 10px; }
.card-ico { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--green-50); color: var(--green-700); flex-shrink: 0; }
.card-ico svg { width: 18px; height: 18px; }
.card-ico[data-tone="amber"] { background: var(--gold-50); color: #8a6d16; }
.card-ico[data-tone="blue"] { background: #eef4fd; color: #1d4ed8; }
.card-ico[data-tone="rose"] { background: #fdf0f2; color: #be123c; }
.card-ico[data-tone="lime"] { background: #f2f9e8; color: #4d7c0f; }
.card-ico[data-tone="violet"] { background: #f5f0fd; color: #6d28d9; }
.card-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--green-700); }
.card-meta { font-size: 11px; color: var(--muted); margin-top: 1px; }
.modul-card h3 { font-size: 15px; font-weight: 800; letter-spacing: -.01em; }
.modul-card p { font-size: 12.5px; color: var(--muted); flex: 1; }
.card-foot { display: flex; align-items: center; gap: 8px; padding-top: 4px; }
.card-foot .btn { flex: 1; }

/* ----------------------------------------------------------------- riwayat */
.history-list { display: flex; flex-direction: column; gap: 10px; padding-bottom: 56px; }
.history-item { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; display: flex; align-items: center; gap: 14px; }
.history-item h3 { font-size: 14px; font-weight: 700; }
.history-item p { font-size: 12px; color: var(--muted); margin-top: 2px; }
.history-actions { margin-left: auto; display: flex; gap: 6px; }
.history-bar { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }

/* ------------------------------------------------------------------ panduan */
.guide-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 26px 28px; margin-bottom: 16px; box-shadow: var(--shadow-sm); }
.guide-card h2 { font-size: 18px; font-weight: 800; display: flex; align-items: center; gap: 10px; letter-spacing: -.02em; }
.guide-card .num { font-size: 11px; font-weight: 800; color: var(--green-700); background: var(--green-50); border-radius: 7px; padding: 3px 7px; letter-spacing: .05em; }
.guide-card > p { font-size: 13.5px; color: var(--ink-2); margin-top: 12px; }
.guide-note { font-size: 12px; color: var(--muted); margin-top: 12px; background: var(--sand); border-radius: 8px; padding: 9px 12px; }
.cinta-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 10px; margin-top: 16px; }
.cinta-card { background: var(--sand); border: 1px solid #ece5d2; border-radius: 11px; padding: 14px; }
.cinta-num { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 6px; background: var(--gold-50); color: #8a6d16; font-size: 11px; font-weight: 800; margin-bottom: 8px; }
.cinta-card h3 { font-size: 13px; font-weight: 700; }
.cinta-card p { font-size: 12px; color: var(--muted); margin-top: 5px; }
.struct-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; margin-top: 16px; }
.struct-col h3 { font-size: 13.5px; font-weight: 700; color: var(--green-800); }
.struct-col ul { margin: 8px 0 0; padding-left: 18px; }
.struct-col li { font-size: 12.5px; color: var(--ink-2); margin: 4px 0; }
.guide-table { width: 100%; border-collapse: collapse; margin-top: 16px; font-size: 12.5px; }
.guide-table th, .guide-table td { border: 1px solid var(--line); padding: 9px 11px; text-align: left; vertical-align: top; }
.guide-table thead th { background: #f6f9f5; font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--green-800); }
.model-guide { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; margin-top: 16px; }
.model-guide h3 { font-size: 13.5px; font-weight: 700; color: var(--green-800); }
.model-guide ol { margin: 8px 0 0; padding-left: 18px; }
.model-guide li { font-size: 12.5px; color: var(--ink-2); margin: 3px 0; }
.formula-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 12px; margin-top: 16px; }
.formula-grid > div { background: #f7faf6; border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; }
.formula-grid h3 { font-size: 12.5px; font-weight: 700; }
.formula-grid code { display: block; margin-top: 6px; font-family: "IBM Plex Mono", ui-monospace, monospace; font-size: 12px; color: var(--green-900); }
.steps-guide { margin: 14px 0 0; padding-left: 20px; }
.steps-guide li { font-size: 13.5px; color: var(--ink-2); margin: 8px 0; }

/* ------------------------------------------------------------------ dialog */
.dialog {
  width: min(1000px, 94vw); max-height: 92vh; border: 0; border-radius: 16px; padding: 0;
  box-shadow: 0 30px 80px -20px rgba(16, 61, 36, .5); background: #fff; color: var(--ink);
}
.dialog::backdrop { background: rgba(16, 30, 22, .55); backdrop-filter: blur(3px); }
.dialog-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 16px 18px; border-bottom: 1px solid var(--line); flex-wrap: wrap; position: sticky; top: 0; background: #fff; z-index: 2; border-radius: 16px 16px 0 0; }
.dialog-eyebrow { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--green-700); }
.dialog-head h2 { font-size: 18px; font-weight: 800; margin-top: 3px; letter-spacing: -.02em; }
.dialog-head p { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.dialog-actions { display: flex; align-items: center; gap: 6px; }
.dialog-body { overflow: auto; max-height: calc(92vh - 90px); padding: 18px; background: #eef1ea; }

/* ------------------------------------------------------------------- misc */
.toast {
  position: fixed; right: 24px; bottom: 24px; transform: translateY(14px);
  background: var(--green-900); color: #fff; font-size: 13px; font-weight: 600;
  padding: 11px 18px; border-radius: 12px; box-shadow: var(--shadow); opacity: 0; pointer-events: none;
  transition: opacity .2s, transform .2s; z-index: 200; max-width: min(380px, 90vw); text-align: left;
}
.toast.is-show { opacity: 1; transform: translateY(0); }
.fab-preview { display: none; }
.empty-note { text-align: center; color: var(--muted); font-size: 13px; padding: 30px 0 60px; }

main { flex: 1 0 auto; }
.site-footer { flex-shrink: 0; border-top: 1px solid var(--line); background: #fff; padding: 26px 0 32px; margin-top: 8px; }
.footer-inner { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.footer-brand { display: flex; gap: 12px; align-items: flex-start; }
.footer-brand strong { font-size: 14px; font-weight: 800; }
.footer-brand p { font-size: 12px; color: var(--muted); margin-top: 3px; max-width: 420px; }
.footer-note { font-size: 11.5px; color: var(--muted-2); max-width: 460px; }

.only-sm { display: none; }

/* ------------------------------------------------------------- responsive */
@media (max-width: 1180px) {
  .workbench { grid-template-columns: 1fr; }
  .preview-panel { position: fixed; inset: 0; z-index: 90; max-height: none; border-radius: 0; border: 0; display: none; }
  body.preview-open { overflow: hidden; }
  body.preview-open .preview-panel { display: flex; }
  .preview-body { padding: 12px; }
  .sheet { padding: 34px 28px 44px; font-size: 12.5px; }
  .fab-preview {
    display: inline-flex; position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%);
    align-items: center; gap: 8px; z-index: 70; border: 0; border-radius: 999px;
    background: var(--green-800); color: #fff; font: inherit; font-size: 13.5px; font-weight: 700;
    padding: 12px 22px; box-shadow: 0 10px 24px -8px rgba(16, 61, 36, .7); cursor: pointer;
  }
  .fab-preview svg { width: 16px; height: 16px; }
  #btnClosePreview { display: inline-grid; }
  .toast { left: 16px; right: 16px; bottom: 84px; max-width: none; }
}
@media (min-width: 1181px) {
  #btnClosePreview { display: none; }
}
@media (max-width: 900px) {
  .wrap { padding: 0 16px; }
  .site-nav { display: none; }
  .only-lg { display: none; }
  .only-sm { display: inline-grid; }
  .header-inner { height: 62px; gap: 12px; }
  .brand-text small { display: none; }
  .hero { padding-top: 24px; gap: 20px; }
  .hero-stats { display: none; }
  .workbench { gap: 14px; }
  .form-panel { padding: 16px; }
  .grid-3 { grid-template-columns: 1fr; }
  .empty-grid { grid-template-columns: 1fr; }
  .dialog { width: 100vw; max-height: 100vh; border-radius: 0; }
  .dialog-body { max-height: calc(100vh - 110px); }
  .dialog-actions { width: 100%; }
  .dialog-actions .btn { flex: 1; }
  .page-head { padding-top: 24px; }
  .search input { width: 100%; }
  .page-head-actions { width: 100%; }
  .search { width: 100%; }
  .guide-card { padding: 20px 18px; }
  .history-item { flex-wrap: wrap; }
  .history-actions { margin-left: 0; width: 100%; }
  .history-actions .btn { flex: 1; }
  .site-footer { padding-bottom: 84px; }
  .fab-preview { bottom: 16px; }
  .mobile-nav:not([hidden]) { display: flex; }
}
@media (max-width: 560px) {
  .grid-2 { grid-template-columns: 1fr; }
  .span-2 { grid-column: span 1; }
  .model-grid { grid-template-columns: 1fr 1fr; }
  .segmented-6 button { padding: 6px 4px; }
  .hero h1 { font-size: 24px; }
  .preview-head { padding: 12px; }
  .preview-title h2 { font-size: 14px; }
  .sheet { padding: 24px 18px 34px; font-size: 12px; }
  .sheet .doc-kop__madrasah { font-size: 15px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}
