/* ============================================================
   ADIP Tools v6.1 — "Tenang"
   Revisi arah visual dari v6.0 "Kaca Cair": hasil evaluasi
   menunjukan efek kaca + glow + orbs terbaca sebagai template
   AI generik. Arah baru: tenang, solid, presisi.
   - Base ARANG HANGAT #161311 dipertahankan, satu aksen CORAL #ff6f61
     dipakai HEMAT (penanda kecil, status fungsional)
   - Permukaan SOLID (tanpa backdrop-filter), border hairline
     1px rgba(255,255,255,.08), TANPA glow / colored shadow
   - Hierarki dipikul tipografi + whitespace, bukan efek
   - Motion minimal: fade cepat, hormati prefers-reduced-motion
   - Beranda PENDEK anti-capek-scroll: hero + Lanjutkan +
     Populer (carousel) + Kategori (grid 4 kolom) + Riwayat
   - Direktori vertikal di view #/semua dan #/k/<id>
   - Bottom tab bar solid + indikator halus
   Z-index: grain 200 · toast 99 · palette 80 · tabs 60 · header 40.
   Shape: kartu 18px, kontrol 12px, pill HANYA chip/tab/tag.
   Kontrak: kelas di bawah "PRIMITIF" dipakai core.js + 110 tools.
   Jangan hapus, boleh restyle mengikuti tema.
   ============================================================ */
@font-face {
  font-family: 'Bricolage Grotesque';
  src: url('fonts/bricolage-grotesque.woff2') format('woff2');
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}
:root {
  --bg: #161311;
  --deep: #100e0c;
  --surface: #1e1a16;
  --surface-2: #262019;
  --line: #332a21;
  --line-soft: #251f18;
  --hair: rgba(255, 255, 255, 0.08);
  --txt: #f6f1e8;
  --mut: #c9bda9;
  --faint: #9d9078;
  --dim: #6e6252;
  --acc: #ff6f61;
  --acc-ink: #2b100a;
  --acc-soft: rgba(255, 111, 97, 0.12);
  --acc-line: rgba(255, 111, 97, 0.38);
  --ok: #7ccf8f;
  --warn: #fbbf24;
  --err: #f87171;
  --info: #8ab8ff;
  --r-card: 18px;
  --r-ctl: 12px;
  --font-d: 'Bricolage Grotesque', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-b: 'Bricolage Grotesque', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-m: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --spring: cubic-bezier(0.34, 1.45, 0.64, 1);
  --snappy: cubic-bezier(0.22, 1, 0.36, 1);
  --lux: cubic-bezier(0.19, 1, 0.22, 1);
  --z-header: 40;
  --z-tabs: 60;
  --z-pal: 80;
  --z-toast: 99;
  --z-grain: 200;
}
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { background: var(--bg); color-scheme: dark; }
body {
  background: var(--bg); color: var(--txt);
  font-family: var(--font-b);
  font-size: 15px; line-height: 1.55;
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
#app { position: relative; z-index: 1; }
/* grain halus: fixed, pointer-events-none */
body::after {
  content: ""; position: fixed; inset: 0; z-index: var(--z-grain); pointer-events: none;
  opacity: 0.032;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)'/%3E%3C/svg%3E");
}
a { color: inherit; }
::selection { background: var(--acc); color: var(--acc-ink); }
.mono { font-family: var(--font-m); }

/* ---------- primitif permukaan: solid + hairline ---------- */
.glass {
  background: var(--surface);
  border: 1px solid var(--hair);
}

.wrap { max-width: 680px; margin: 0 auto; padding: 0 16px 120px; }
.wrap.narrow { max-width: 640px; }

/* ---------- transisi antar halaman ---------- */
@keyframes view-in { from { opacity: 0; transform: translateY(10px) scale(0.99); } to { opacity: 1; transform: none; } }
.view { animation: view-in 0.3s var(--snappy); }

/* ---------- entrance beranda: fade cepat, stagger rapat ---------- */
.rise { opacity: 0; animation: rise-in 0.5s var(--snappy) forwards; animation-delay: calc(var(--i, 0) * 55ms); }
@keyframes rise-in { from { opacity: 0; transform: translateY(10px) scale(0.985); } to { opacity: 1; transform: none; } }

/* ---------- headline: masked reveal ala editorial (bukan fade generik) ---------- */
.hero h1 .w { display: inline-block; }
.hero h1 .mask { display: inline-block; overflow: hidden; vertical-align: bottom; padding: 0.08em 0 0.12em; margin: -0.08em 0 -0.12em; }
.hero h1 .mi { display: inline-block; transform: translateY(115%) rotate(2.5deg); transform-origin: 0% 100%; animation: mi-up 1.05s var(--lux) forwards; animation-delay: calc(0.12s + var(--i, 0) * 130ms); }
@keyframes mi-up { to { transform: none; } }
/* sapaan: fade naik yang tenang (typewriter dicabut — terlalu klise) */
.hero .hi { opacity: 0; animation: hi-in 0.9s var(--lux) 0.72s forwards; }
@keyframes hi-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
/* search: masuk dengan koreografi */
.hero .hsearch { opacity: 0; animation: hs-in 1s var(--lux) 0.55s forwards; }
@keyframes hs-in { from { opacity: 0; transform: translateY(18px) scale(0.985); } to { opacity: 1; transform: none; } }
/* transisi antar halaman: View Transitions API */
::view-transition-old(root) { animation: vt-out 0.32s var(--snappy); }
::view-transition-new(root) { animation: vt-in 0.55s var(--snappy); }
@keyframes vt-out { to { opacity: 0; transform: translateY(-14px) scale(0.992); } }
@keyframes vt-in { from { opacity: 0; transform: translateY(18px); } }

/* ---------- header ramping (sticky), solid ---------- */
.top {
  position: sticky; top: 0; z-index: var(--z-header);
  display: flex; align-items: center; justify-content: space-between;
  min-height: 60px; margin: 0 -16px; padding: 8px 16px;
  background: var(--bg);
  border-bottom: 1px solid var(--hair);
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.mark {
  width: 32px; height: 32px; border-radius: 10px; flex: none;
  background: var(--acc); color: var(--acc-ink);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-d); font-weight: 800; font-size: 17px;
}
.brand .wm { font-family: var(--font-d); font-weight: 750; font-size: 16.5px; letter-spacing: -0.015em; }
.brand .wm em { font-style: normal; color: var(--acc); }
.top-right { display: flex; align-items: center; gap: 8px; }
.topcount {
  font-family: var(--font-m); font-size: 12px; color: var(--dim);
  border: 1px solid var(--line); border-radius: 999px; padding: 7px 12px;
  white-space: nowrap; background: rgba(255, 255, 255, 0.02);
}
.topcount b { color: var(--txt); }
.icobtn {
  width: 40px; height: 40px; border-radius: 12px; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--surface); border: 1px solid var(--hair);
  color: var(--mut); font-size: 18px; cursor: pointer;
  transition: transform 0.1s var(--ease), color 0.15s, border-color 0.15s;
}
.icobtn:hover { color: var(--txt); border-color: var(--acc-line); }
.icobtn:active { transform: scale(0.92); }

/* ---------- hero: sapaan + headline + search ---------- */
.hero { padding: 22px 0 0; }
.hero .hi { color: var(--faint); font-size: 14px; margin-bottom: 8px; }
.hero h1 {
  font-family: var(--font-d); font-weight: 800;
  font-size: clamp(36px, 9.5vw, 56px);
  line-height: 1.02; letter-spacing: -0.035em;
  margin-bottom: 18px;
}
.hero h1 .qm { color: var(--acc); }

/* ---------- search ---------- */
.hsearch {
  position: relative; border-radius: var(--r-card);
  transition: border-color 0.2s;
}
.hsearch .glyph {
  position: absolute; left: 18px; top: 50%; transform: translateY(-50%);
  color: var(--faint); font-size: 20px; pointer-events: none; transition: color 0.2s;
}
.hsearch input {
  width: 100%; background: transparent; border: 0; outline: 0;
  color: var(--txt); border-radius: var(--r-card);
  padding: 17px 18px 17px 50px; font-size: 17px; font-family: inherit;
}
.hsearch input::placeholder { color: var(--faint); }
.hsearch:focus-within { border-color: var(--acc-line); }
.hsearch:focus-within .glyph { color: var(--acc); }

/* ---------- kartu "Lanjutkan": baris tenang, aksen hemat ---------- */
.contd {
  display: flex; align-items: center; gap: 14px;
  margin-top: 20px; padding: 14px 16px; border-radius: var(--r-card);
  text-decoration: none;
  transition: transform 0.12s var(--ease), border-color 0.15s;
}
.contd:hover { border-color: rgba(255, 255, 255, 0.16); }
.contd:active { transform: scale(0.97); }
.contd .cic {
  width: 50px; height: 50px; border-radius: 14px; flex: none;
  background: var(--acc); color: var(--acc-ink);
  display: flex; align-items: center; justify-content: center; font-size: 25px;
}
.contd .ctx { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.contd .clbl {
  font-size: 10.5px; font-weight: 800; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--dim);
}
.contd .cnm {
  font-family: var(--font-d); font-weight: 750; font-size: 16.5px; letter-spacing: -0.015em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.contd .cts { font-size: 12.5px; color: var(--faint); }
.contd .cgo { font-size: 24px; color: var(--dim); flex: none; padding-right: 2px; }

/* ---------- section: label editorial kecil ---------- */
.sec { margin-top: 30px; }
.sechead { display: flex; align-items: baseline; gap: 10px; margin-bottom: 12px; padding: 0 2px; }
.sechead h2 {
  font-family: var(--font-b); font-weight: 700; font-size: 11.5px;
  letter-spacing: 0.12em; text-transform: uppercase; color: var(--faint);
}
.sechead .n { font-family: var(--font-m); font-size: 12px; color: var(--faint); margin-left: auto; }

/* ---------- carousel horizontal: snap, swipe ---------- */
.hscroll {
  display: flex; gap: 10px; overflow-x: auto;
  margin: 0 -16px; padding: 4px 16px 10px;
  scroll-snap-type: x mandatory;
  scrollbar-width: none; -webkit-overflow-scrolling: touch;
}
.hscroll::-webkit-scrollbar { display: none; }
.hcard {
  flex: 0 0 148px; scroll-snap-align: start;
  display: flex; flex-direction: column; gap: 9px;
  border-radius: 16px; padding: 14px 13px;
  text-decoration: none;
  transition: transform 0.14s var(--ease), border-color 0.15s;
}
.hcard:hover { border-color: rgba(255, 255, 255, 0.16); }
.hcard:active { transform: scale(0.97); }
.hcard .hic {
  width: 42px; height: 42px; border-radius: 12px; flex: none;
  background: rgba(255, 255, 255, 0.05); border: 1px solid var(--hair);
  display: flex; align-items: center; justify-content: center; font-size: 21px;
}
.hcard .hnm {
  font-family: var(--font-d); font-weight: 700; font-size: 13.5px;
  letter-spacing: -0.01em; line-height: 1.3; color: var(--txt);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.hcard .hct {
  margin-top: auto;
  font-size: 10px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--dim);
}
/* fade tepi saat konten terpotong */
.hscroll.fx-r {
  -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent);
  mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent);
}
.hscroll.fx-l {
  -webkit-mask-image: linear-gradient(to left, #000 calc(100% - 28px), transparent);
  mask-image: linear-gradient(to left, #000 calc(100% - 28px), transparent);
}
.hscroll.fx-l.fx-r {
  -webkit-mask-image: linear-gradient(to right, transparent, #000 28px, #000 calc(100% - 28px), transparent);
  mask-image: linear-gradient(to right, transparent, #000 28px, #000 calc(100% - 28px), transparent);
}

/* ---------- grid kategori: 4 kolom ubin solid ---------- */
.catgrid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
@media (min-width: 700px) { .catgrid { grid-template-columns: repeat(7, 1fr); } }
.cattile {
  display: flex; flex-direction: column; align-items: center; gap: 7px;
  border-radius: 16px; padding: 15px 6px 13px;
  font-family: inherit; color: var(--txt); cursor: pointer; text-decoration: none;
  transition: transform 0.22s var(--spring), border-color 0.15s, box-shadow 0.22s var(--spring);
}
.cattile:active { transform: scale(0.94); }
.cattile:hover { border-color: rgba(255, 255, 255, 0.16); transform: translateY(-3px); box-shadow: 0 8px 22px rgba(0, 0, 0, 0.35); }
.cattile:hover .ci { animation: ci-bounce 0.42s var(--ease); }
@keyframes ci-bounce { 35% { transform: translateY(-5px) scale(1.1); } 70% { transform: translateY(1px); } }
.cattile .ci { font-size: 26px; line-height: 1; }
.cattile .cl { font-size: 12px; font-weight: 700; letter-spacing: -0.005em; text-align: center; line-height: 1.25; }
.cattile .cn { font-family: var(--font-m); font-size: 11.5px; font-weight: 600; color: var(--faint); }

/* ---------- tombol "Semua tools" ---------- */
.allbtn {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 26px; padding: 16px 18px; border-radius: var(--r-card);
  text-decoration: none; font-family: var(--font-d); font-weight: 750; font-size: 16px;
  letter-spacing: -0.015em; color: var(--txt);
  transition: transform 0.12s var(--ease), border-color 0.15s;
}
.allbtn:hover { border-color: rgba(255, 255, 255, 0.16); }
.allbtn:active { transform: scale(0.97); }
.allbtn .ago { color: var(--dim); font-size: 22px; }
.allbtn .an { font-family: var(--font-m); font-size: 12px; color: var(--dim); font-weight: 400; }

/* ---------- grid kartu tools (view kategori / semua / favorit) ---------- */
.tgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (min-width: 700px) { .tgrid { grid-template-columns: repeat(3, 1fr); } }
.tcard {
  position: relative; display: flex; flex-direction: column; gap: 10px;
  border-radius: var(--r-card); padding: 14px 13px 13px;
  text-decoration: none; min-height: 128px;
  transition: transform 0.22s var(--spring), border-color 0.15s, box-shadow 0.22s var(--spring);
}
.tcard:hover { border-color: rgba(255, 255, 255, 0.16); transform: translateY(-3px); box-shadow: 0 10px 26px rgba(0, 0, 0, 0.38); }
.tcard:active { transform: translateY(-1px) scale(0.97); }
.tcard .tic {
  width: 44px; height: 44px; border-radius: 12px; flex: none;
  background: rgba(255, 255, 255, 0.05); border: 1px solid var(--hair);
  display: flex; align-items: center; justify-content: center; font-size: 22px;
}
.tcard .nm {
  font-family: var(--font-d); font-weight: 700; font-size: 14.5px;
  letter-spacing: -0.01em; line-height: 1.28; color: var(--txt);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.tcard .ds {
  color: var(--faint); font-size: 12.5px; line-height: 1.45;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.tcard .ct {
  margin-top: auto; padding-top: 2px;
  font-size: 10px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--dim);
}
.tcard .fav {
  position: absolute; top: 6px; right: 6px;
  width: 36px; height: 36px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  background: none; border: 0; cursor: pointer;
  color: var(--dim); font-size: 17px; opacity: 0.5;
  transition: opacity 0.15s, color 0.15s, transform 0.12s var(--ease), background 0.15s;
}
.tcard .fav.on { opacity: 1; color: var(--acc); }
.tcard .fav:hover { opacity: 1; background: var(--acc-soft); }
.tcard .fav:active { transform: scale(0.8); }
.tcard .fav.pop { animation: fav-pop 0.45s var(--spring); }
@keyframes fav-pop { 30% { transform: scale(1.45) rotate(-12deg); } 55% { transform: scale(0.88) rotate(4deg); } 75% { transform: scale(1.06); } }
.tcard:has(.fav:active) { transform: none; }

/* ---------- kepala halaman kategori ---------- */
.cat-head { display: flex; align-items: center; gap: 14px; padding: 8px 0 18px; }
.cat-head .ctic {
  width: 56px; height: 56px; border-radius: 16px; flex: none;
  background: rgba(255, 255, 255, 0.05); border: 1px solid var(--hair);
  display: flex; align-items: center; justify-content: center; font-size: 27px;
}
.cat-head h2 { font-family: var(--font-d); font-size: 26px; font-weight: 800; letter-spacing: -0.025em; }
.cat-head .csub { color: var(--faint); font-size: 13px; margin-top: 2px; }
.pagetitle { font-family: var(--font-d); font-size: 26px; font-weight: 800; letter-spacing: -0.025em; padding: 8px 0 14px; }

/* ---------- empty state ---------- */
.empty {
  text-align: center; padding: 52px 20px;
  border: 1px dashed var(--line); border-radius: var(--r-card); margin-top: 12px;
}
.empty b { display: block; font-family: var(--font-d); font-size: 18px; margin-bottom: 8px; letter-spacing: -0.01em; }
.empty p { color: var(--dim); font-size: 14px; }
.empty .sugx { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 16px; }
.empty .sugx .schip {
  font: inherit; font-size: 13px; font-weight: 600; color: var(--mut); cursor: pointer;
  border: 1px solid var(--line); border-radius: 999px; padding: 8px 14px;
  background: var(--surface);
  transition: transform 0.1s var(--ease), color 0.15s, border-color 0.15s;
}
.empty .sugx .schip:hover { color: var(--txt); border-color: var(--acc-line); }
.empty .sugx .schip:active { transform: scale(0.94); }

/* ---------- halaman tool ---------- */
.back {
  display: inline-flex; align-items: center; gap: 6px; margin: 20px 0 2px;
  color: var(--mut); text-decoration: none; font-size: 14px; font-weight: 600;
  padding: 8px 4px;
  transition: color 0.15s, transform 0.1s var(--ease);
}
.back:hover { color: var(--acc); }
.back:active { transform: scale(0.96); }
.tool-head { display: flex; gap: 14px; align-items: flex-start; padding: 14px 0 20px; }
.tool-head .tic {
  width: 58px; height: 58px; border-radius: 16px; flex: none;
  background: rgba(255, 255, 255, 0.05); border: 1px solid var(--hair);
  display: flex; align-items: center; justify-content: center; font-size: 28px;
}
.tool-head .th { flex: 1; min-width: 0; }
.tool-head h2 {
  font-family: var(--font-d); font-size: 25px; letter-spacing: -0.025em;
  font-weight: 800; line-height: 1.15;
}
.tool-head .meta { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; margin-top: 10px; }
.tool-head .meta .tag {
  font-size: 10.5px; font-weight: 700; letter-spacing: 0.09em; text-transform: uppercase;
  border: 1px solid var(--acc-line); border-radius: 999px; padding: 4px 11px;
  color: var(--acc); background: var(--acc-soft);
}
.tool-head .meta .ds { color: var(--mut); font-size: 14px; line-height: 1.55; }
.tool-head .tacts { display: flex; gap: 8px; flex: none; }
.tool-head .tacts .fav.on { color: var(--acc); border-color: var(--acc-line); }
.tool {
  border-radius: var(--r-card); padding: 20px 16px;
  display: flex; flex-direction: column; gap: 15px;
}
@media (min-width: 560px) { .tool { padding: 24px 22px; } }

/* skeleton */
@keyframes shimmer { from { opacity: 0.35; } to { opacity: 1; } }
.skel { display: flex; flex-direction: column; gap: 12px; animation: shimmer 0.7s ease-in-out infinite alternate; }
.skel i { display: block; background: var(--surface-2); border-radius: 8px; height: 48px; }
.skel i.short { height: 22px; width: 45%; }
.skel i.tall { height: 120px; }

.related { margin-top: 32px; }

/* ============================================================
   PRIMITIF FORM (dipakai core.js + semua tools — jangan hapus)
   ============================================================ */
.fld { display: flex; flex-direction: column; gap: 8px; }
.fld > label { font-size: 13px; font-weight: 650; color: var(--mut); }
.hint { font-size: 12.5px; color: var(--faint); }
.inp {
  width: 100%; background: var(--deep); border: 1px solid var(--line);
  color: var(--txt); border-radius: var(--r-ctl); padding: 13px 14px;
  font-size: 16px; outline: none; font-family: inherit;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.inp::placeholder { color: var(--faint); }
.inp:focus { border-color: var(--acc-line); box-shadow: 0 0 0 3px rgba(255, 111, 97, 0.12); }
textarea.inp { resize: vertical; min-height: 96px; line-height: 1.55; }
select.inp { appearance: none; -webkit-appearance: none; }
.row { display: flex; gap: 10px; flex-wrap: wrap; }
.row > * { flex: 1 1 0; min-width: 0; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 480px) { .grid2 { grid-template-columns: 1fr; } }

.btn {
  border: 1px solid var(--line); background: var(--surface-2); color: var(--txt);
  border-radius: var(--r-ctl); padding: 13px 18px; font-size: 14.5px; font-weight: 700;
  cursor: pointer; font-family: inherit; text-align: center;
  transition: transform 0.1s var(--ease), background 0.15s, border-color 0.15s;
  min-height: 48px;
}
.btn:hover { border-color: #4a3d2f; }
.btn:active { transform: scale(0.97); }
.btn.primary { background: var(--acc); color: var(--acc-ink); border-color: var(--acc); }
.btn.primary:hover { filter: brightness(1.05); }
.btn.danger { border-color: #7f2d22; color: #fca5a5; }
.btn.small { padding: 9px 14px; min-height: 0; font-size: 13px; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }
.btn.done { border-color: var(--ok); color: var(--ok); }

/* focus keyboard */
.btn:focus-visible, .cattile:focus-visible, .tcard:focus-visible,
.back:focus-visible, .hcard:focus-visible, .allbtn:focus-visible,
.pkey:focus-visible, .drumgrid .cell:focus-visible, .tapzone:focus-visible,
.fav:focus-visible, .tab:focus-visible, .icobtn:focus-visible,
.hsearch input:focus-visible {
  outline: 2px solid var(--acc);
  outline-offset: 2px;
}
.inp:focus-visible { outline: none; }

/* ---------- output ---------- */
@keyframes out-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.out {
  background: var(--deep); border: 1px solid var(--line-soft); border-radius: var(--r-ctl);
  padding: 15px; font-size: 14px; word-break: break-word; overflow-x: auto;
}
.out:not([hidden]) { animation: out-in 0.22s var(--ease); }
.out pre { white-space: pre-wrap; font-family: var(--font-m); font-size: 13px; }
.out .retry { margin-top: 14px; }
.kv { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px dashed var(--line); }
.kv:last-child { border-bottom: none; }
.kv .k { color: var(--mut); font-size: 13px; }
.kv .v { font-weight: 650; text-align: right; }
.big { font-size: 28px; font-weight: 800; letter-spacing: -0.02em; font-family: var(--font-m); }
.ok { color: var(--ok); } .warn { color: var(--warn); } .err { color: var(--err); } .info { color: var(--info); }
.mut { color: var(--mut); } .dim { color: var(--dim); }
.center { text-align: center; }

.card {
  background: var(--surface-2); border: 1px solid var(--line-soft);
  border-radius: var(--r-card); padding: 16px;
  display: flex; flex-direction: column; gap: 10px;
}

/* ---------- toast: solid ---------- */
.toast {
  position: fixed; left: 50%; bottom: 96px; transform: translateX(-50%) translateY(14px);
  background: #221c17; color: var(--txt); font-weight: 650; font-size: 14px;
  border: 1px solid var(--line);
  padding: 12px 20px; border-radius: 12px; opacity: 0; pointer-events: none;
  transition: opacity 0.2s, transform 0.2s var(--ease); z-index: var(--z-toast);
  max-width: 92vw; text-align: center;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- footer: 1 baris ---------- */
footer.foot {
  text-align: center; color: var(--dim); font-size: 12.5px;
  padding: 40px 16px 8px; line-height: 1.7;
}
footer.foot b { color: var(--mut); }

/* ============================================================
   Kelas kustom modul tools (kontrak render — jangan hapus)
   ============================================================ */
canvas.prev { max-width: 100%; border-radius: var(--r-ctl); border: 1px solid var(--line); display: block; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
table.tbl th, table.tbl td { border: 1px solid var(--line); padding: 9px 10px; text-align: left; }
table.tbl th { background: var(--surface-2); font-weight: 650; }
.piano { display: flex; gap: 4px; overflow-x: auto; padding: 4px 0; }
.pkey {
  flex: 1 0 46px; height: 124px; border-radius: 7px; border: 1px solid var(--line);
  background: #f6f1e8; color: #161311; font-weight: 700; font-size: 12px;
  display: flex; align-items: flex-end; justify-content: center; padding-bottom: 8px; cursor: pointer;
}
.pkey.black { background: #141210; color: #f6f1e8; border-color: #4a3d2f; flex-basis: 34px; height: 82px; margin: 0 -9px; z-index: 1; }
.pkey:active { transform: scale(0.95); }
.drumgrid { display: grid; gap: 5px; }
.drumgrid .cell { aspect-ratio: 1; border-radius: 7px; border: 1px solid var(--line); background: var(--surface-2); cursor: pointer; }
.drumgrid .cell.on { background: var(--acc); border-color: var(--acc); }
.drumgrid .cell.play { outline: 2px solid var(--info); }
.wheel { width: 230px; height: 230px; margin: 8px auto; display: block; max-width: 100%; }
.tapzone {
  background: var(--surface-2); border: 2px dashed #4a3d2f; border-radius: var(--r-card);
  min-height: 150px; display: flex; align-items: center; justify-content: center;
  font-size: 18px; font-weight: 700; cursor: pointer; user-select: none; -webkit-user-select: none;
  text-align: center; padding: 20px; transition: transform 0.1s var(--ease), border-color 0.15s;
}
.tapzone:active { transform: scale(0.98); border-color: var(--acc); }
.spin { width: 240px; height: 240px; margin: 10px auto; display: block; max-width: 100%; }
.note {
  background: var(--surface-2); border: 1px solid var(--line-soft); border-left: 3px solid var(--acc);
  border-radius: 8px; padding: 11px 13px; font-size: 13.5px; color: var(--mut);
}
.note b, .note strong { color: var(--txt); }
pre.pre, .pre {
  background: var(--deep); border: 1px solid var(--line-soft); border-radius: var(--r-ctl);
  padding: 14px; font-family: var(--font-m); font-size: 13px;
  white-space: pre-wrap; word-break: break-word; overflow-x: auto;
}
pre.ascii { font-size: 11px; line-height: 1.35; }
.diffbox { border: 1px solid var(--line); border-radius: var(--r-ctl); overflow: hidden; font-family: var(--font-m); font-size: 12.5px; }
.diffbox div { padding: 7px 11px; white-space: pre-wrap; word-break: break-word; }
.diff-add { background: rgba(124, 207, 143, 0.12); color: #a9e5bb; }
.diff-del { background: rgba(248, 113, 113, 0.12); color: #fca5a5; }
.diff-same { color: var(--dim); }
.fancy-out, .zalgo-out { display: flex; flex-direction: column; gap: 8px; }
.fancy-out .frow, .zalgo-out .frow {
  display: flex; gap: 8px; align-items: center;
  background: var(--deep); border: 1px solid var(--line-soft); border-radius: var(--r-ctl);
  padding: 11px 13px;
}
.fancy-out .ftxt { flex: 1; font-size: 16px; word-break: break-word; }
.opts { display: flex; gap: 6px 16px; flex-wrap: wrap; }
.chk { display: flex; align-items: center; gap: 9px; font-size: 14px; cursor: pointer; min-height: 44px; }
.chk input { width: 20px; height: 20px; accent-color: var(--acc); }
ul.list, ol.list { padding-left: 20px; display: flex; flex-direction: column; gap: 7px; font-size: 14px; }
.warna { display: inline-flex; align-items: center; gap: 9px; }
.warna i { width: 30px; height: 30px; border-radius: 8px; border: 1px solid var(--line); display: inline-block; flex: none; }
mark { background: var(--acc); color: var(--acc-ink); border-radius: 3px; padding: 0 3px; }

/* ---------- pola bersama ---------- */
.monoall { font-family: var(--font-m); user-select: all; -webkit-user-select: all; }
h3.h3 { margin: 0 0 10px; font-size: 16px; font-weight: 700; letter-spacing: -0.01em; }
hr.divi { border: none; border-top: 1px solid var(--line); margin: 18px 0; }
.pick { display: flex; align-items: center; gap: 10px; font-size: 14px; padding: 7px 0; cursor: pointer; min-height: 44px; }
.pick input { width: 20px; height: 20px; accent-color: var(--acc); flex: none; }
.mt8 { margin-top: 8px; }

/* invoice (terang saat print) */
.invoice { background: #fff; color: #111; border-radius: 12px; padding: 22px 18px; font-size: 14px; }
.invoice h3 { color: #000; }
.inv-head { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.inv-head .dim, .invoice .dim { color: #666; }
table.inv-item { width: 100%; border-collapse: collapse; margin: 10px 0; font-size: 13px; }
table.inv-item th, table.inv-item td { border-bottom: 1px solid #ddd; padding: 9px 6px; text-align: left; color: #111; }
table.inv-item th { font-weight: 700; }
.inv-tot { display: flex; justify-content: space-between; padding: 5px 0; color: #333; }
.inv-grand {
  display: flex; justify-content: space-between; padding: 9px 0 0;
  font-weight: 800; font-size: 17px; color: #000; border-top: 2px solid #111; margin-top: 6px;
}
.tot, .grand { font-weight: 700; }
@media print {
  body * { visibility: hidden; }
  .invoice, .invoice * { visibility: visible; }
  .invoice { position: absolute; left: 0; top: 0; width: 100%; border-radius: 0; }
}

/* ---------- command palette: solid ---------- */
.pal-wrap {
  position: fixed; inset: 0; z-index: var(--z-pal);
  display: flex; align-items: flex-start; justify-content: center;
  padding: 10vh 16px 16px;
}
.pal-backdrop {
  position: absolute; inset: 0; background: rgba(10, 8, 6, 0.62);
  animation: pal-fade 0.18s var(--ease);
}
.pal {
  position: relative; width: 100%; max-width: 580px;
  background: #211b16;
  border: 1px solid rgba(255, 255, 255, 0.12); border-radius: 18px;
  overflow: hidden;
  animation: pal-in 0.32s var(--spring);
}
@keyframes pal-in { from { opacity: 0; transform: translateY(-12px) scale(0.985); } }
@keyframes pal-fade { from { opacity: 0; } }
.pal-bar { display: flex; align-items: center; gap: 12px; padding: 5px 10px 5px 18px; border-bottom: 1px solid var(--line-soft); }
.pal-bar .glyph { color: var(--acc); font-size: 20px; flex: none; }
.pal-bar input {
  flex: 1; min-width: 0; background: none; border: 0; outline: 0;
  color: var(--txt); font-size: 17px; padding: 15px 0; font-family: inherit;
}
.pal-bar input::placeholder { color: var(--faint); }
.pal-bar kbd {
  flex: none; font-family: var(--font-m); font-size: 11px; color: var(--dim);
  border: 1px solid var(--line); background: var(--deep);
  border-radius: 6px; padding: 4px 9px;
}
.pal-list { max-height: 48vh; overflow-y: auto; padding: 8px; -webkit-overflow-scrolling: touch; }
.pal-sec {
  padding: 10px 14px 4px;
  font-size: 10.5px; font-weight: 700; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--dim);
}
.pal-item {
  display: flex; width: 100%; align-items: center; gap: 13px;
  padding: 10px 12px; border-radius: 12px;
  background: none; border: 0; color: var(--txt);
  font: inherit; text-align: left; cursor: pointer;
  transition: background 0.1s var(--ease);
}
.pal-item .pic {
  width: 40px; height: 40px; border-radius: 11px; flex: none;
  background: rgba(255, 255, 255, 0.05); border: 1px solid var(--hair);
  display: flex; align-items: center; justify-content: center; font-size: 19px;
}
.pal-item .ptx { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 2px; }
.pal-item .pnm { font-family: var(--font-d); font-weight: 700; font-size: 15px; letter-spacing: -0.01em; }
.pal-item .pnm mark { background: var(--acc-soft); color: var(--acc); border-radius: 4px; padding: 0 2px; }
.pal-item .pds {
  color: var(--faint); font-size: 12.5px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.pal-item .pct {
  flex: none; font-size: 10px; font-weight: 700; letter-spacing: 0.07em; text-transform: uppercase;
  color: var(--dim); border: 1px solid var(--line); border-radius: 999px; padding: 4px 10px;
}
.pal-item.act { background: var(--acc-soft); }
.pal-item.act .pic { border-color: var(--acc-line); }
.pal-item.act .pct { color: var(--acc); border-color: var(--acc-line); }
.pal-empty { padding: 30px 20px; text-align: center; color: var(--dim); font-size: 14px; line-height: 1.7; }
.pal-hint {
  display: flex; gap: 18px; padding: 11px 20px;
  border-top: 1px solid var(--line-soft); color: var(--dim); font-size: 12px;
}
.pal-hint kbd {
  font-family: var(--font-m); font-size: 11px; color: var(--mut);
  border: 1px solid var(--line); background: var(--deep);
  border-radius: 6px; padding: 2px 8px; margin-right: 5px;
}
@media (max-width: 560px) {
  .pal-wrap { padding-top: 6vh; }
  .pal-hint { display: none; }
}

/* ---------- bottom tab bar: solid + indikator halus ---------- */
.tabs {
  position: fixed; left: 12px; right: 12px;
  bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  max-width: 460px; margin-left: auto; margin-right: auto;
  z-index: var(--z-tabs); display: flex; gap: 4px; padding: 6px;
  background: #1c1713;
  border: 1px solid rgba(255, 255, 255, 0.09); border-radius: 18px;
  animation: tabs-in 0.3s var(--ease);
}
@keyframes tabs-in { from { opacity: 0; transform: translateY(14px); } }
.tab-ind {
  position: absolute; top: 6px; bottom: 6px; left: 6px;
  width: calc((100% - 12px) / 3);
  border-radius: 13px; background: var(--acc-soft); border: 1px solid var(--acc-line);
  transition: transform 0.28s var(--ease), opacity 0.2s;
  pointer-events: none;
}
.tab {
  position: relative; z-index: 1;
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px;
  min-height: 54px; padding: 9px 6px 8px;
  border: 0; border-radius: 13px; background: none; cursor: pointer;
  color: var(--dim); font-family: var(--font-b); font-size: 11px; font-weight: 650;
  text-decoration: none;
  transition: transform 0.12s var(--ease), color 0.15s;
}
.tab .ti { font-size: 26px; line-height: 1; }
.tab:hover { color: var(--mut); }
.tab:active { transform: scale(0.93); }
.tab.on { color: var(--acc); }

/* ---------- reduced motion ---------- */
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
  .view { animation: none; }
  .rise { opacity: 1; animation: none; }
  .pal, .pal-backdrop, .tabs { animation: none; }
  body::after { display: none; }
}

/* ============================================================
   LAPISAN ANIMASI v6.8.1 — hidup, tapi tetap tenang.
   Prinsip: cepat (<0.4s), halus, sekali jalan. Infinite hanya
   untuk denyut pelan yang nyaris tak terasa.
   ============================================================ */

/* stagger masuk kartu di grid (12 pertama, sisanya bareng) */
.tgrid > .tcard { animation: rise-in 0.34s var(--ease) both; }
.tgrid > .tcard:nth-child(1) { animation-delay: 0.01s; }
.tgrid > .tcard:nth-child(2) { animation-delay: 0.04s; }
.tgrid > .tcard:nth-child(3) { animation-delay: 0.07s; }
.tgrid > .tcard:nth-child(4) { animation-delay: 0.1s; }
.tgrid > .tcard:nth-child(5) { animation-delay: 0.13s; }
.tgrid > .tcard:nth-child(6) { animation-delay: 0.16s; }
.tgrid > .tcard:nth-child(7) { animation-delay: 0.19s; }
.tgrid > .tcard:nth-child(8) { animation-delay: 0.22s; }
.tgrid > .tcard:nth-child(9) { animation-delay: 0.25s; }
.tgrid > .tcard:nth-child(10) { animation-delay: 0.28s; }
.tgrid > .tcard:nth-child(11) { animation-delay: 0.31s; }
.tgrid > .tcard:nth-child(12) { animation-delay: 0.34s; }

/* ubin kategori ikut stagger */
.catgrid > .cattile { animation: rise-in 0.34s var(--ease) both; }
.catgrid > .cattile:nth-child(2) { animation-delay: 0.04s; }
.catgrid > .cattile:nth-child(3) { animation-delay: 0.08s; }
.catgrid > .cattile:nth-child(4) { animation-delay: 0.12s; }
.catgrid > .cattile:nth-child(5) { animation-delay: 0.16s; }
.catgrid > .cattile:nth-child(6) { animation-delay: 0.2s; }
.catgrid > .cattile:nth-child(7) { animation-delay: 0.24s; }
.catgrid > .cattile:nth-child(8) { animation-delay: 0.28s; }

/* headline: tanda tanya coral berdenyut pelan */
.hero h1 .qm { display: inline-block; animation: qm-pulse 2.8s ease-in-out infinite; transform-origin: bottom center; }
@keyframes qm-pulse { 50% { opacity: 0.62; transform: translateY(-3px) rotate(-4deg); } }

/* titik live di badge jumlah tools */
.livedot {
  display: inline-block; width: 7px; height: 7px; border-radius: 50%;
  background: var(--acc); margin-right: 7px; vertical-align: 1px;
  animation: live-ping 2.2s ease-out infinite;
}
@keyframes live-ping {
  0% { box-shadow: 0 0 0 0 rgba(255, 122, 89, 0.45); }
  70% { box-shadow: 0 0 0 8px rgba(255, 122, 89, 0); }
  100% { box-shadow: 0 0 0 0 rgba(255, 122, 89, 0); }
}

/* logo: goyang dikit pas di-hover */
.brand:hover .mark { animation: mark-wig 0.45s var(--ease); }
@keyframes mark-wig { 25% { transform: rotate(-9deg) scale(1.07); } 60% { transform: rotate(6deg); } }

/* ikon halaman tool: pop pas masuk */
.tool-head .tic { animation: tic-pop 0.5s var(--spring); }
@keyframes tic-pop { 0% { transform: scale(0.4) rotate(-14deg); opacity: 0; } 60% { transform: scale(1.12) rotate(4deg); opacity: 1; } }

/* skeleton: shimmer yang jalan, bukan kedip */
.skel { animation: none; }
.skel i {
  background: linear-gradient(100deg, var(--surface-2) 30%, rgba(255,255,255,0.06) 50%, var(--surface-2) 70%);
  background-size: 200% 100%;
  animation: skel-slide 1.4s linear infinite;
}
@keyframes skel-slide { to { background-position: -200% 0; } }

/* hormati yang tidak suka gerak */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}
