/* Wefluence API docs. Tata bahasa iOS / Apple Developer: halaman putih atau hitam pekat,
   bidang abu tanpa garis untuk kode dan kartu, garis rambut, bilah atas kaca buram.
   Warna gelap = palet app/Insider (#000, #1C1C1E, #2C2C2E, #38383A). */
:root {
  --bg: #fff; --fill: #f5f5f7; --fill-2: #e8e8ed; --thumb: #fff;
  --ink: #1d1d1f; --body: #3a3a3c; --muted: #6e6e73; --faint: #8e8e93;
  --line: rgba(60, 60, 67, 0.13); --hover: rgba(120, 120, 128, 0.1); --active: rgba(120, 120, 128, 0.16);
  --link: #1a73e8; --pill-bg: #1d1d1f; --pill-ink: #fff;
  --bar: rgba(255, 255, 255, 0.78); --menu: rgba(255, 255, 255, 0.92); --shadow: 0 12px 40px rgba(0, 0, 0, 0.14), 0 0 0 0.5px rgba(0, 0, 0, 0.08);
  --t-s: #0a7c52; --t-k: #1a73e8; --t-n: #b3261e; --t-c: #8a8a8f; --get: #0a7c52; --get-bg: rgba(10, 124, 82, 0.1); --post: #1a73e8; --post-bg: rgba(26, 115, 232, 0.1);
  --top: 56px;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #000; --fill: #1c1c1e; --fill-2: #2c2c2e; --thumb: #636366;
  --ink: #f5f5f7; --body: #d1d1d6; --muted: #98989d; --faint: #8e8e93;
  --line: rgba(84, 84, 88, 0.55); --hover: rgba(120, 120, 128, 0.18); --active: rgba(120, 120, 128, 0.28);
  --link: #3b8bf0; --pill-bg: #f5f5f7; --pill-ink: #000;
  --bar: rgba(0, 0, 0, 0.72); --menu: rgba(44, 44, 46, 0.9); --shadow: 0 12px 40px rgba(0, 0, 0, 0.5), 0 0 0 0.5px rgba(255, 255, 255, 0.12);
  --t-s: #7fd1ae; --t-k: #8ab4f8; --t-n: #f2b8b5; --t-c: #7c7c82; --get: #7fd1ae; --get-bg: rgba(127, 209, 174, 0.14); --post: #8ab4f8; --post-bg: rgba(138, 180, 248, 0.14);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-padding-top: calc(var(--top) + 24px); -webkit-text-size-adjust: 100%; background: var(--bg); }
body { margin: 0; background: var(--bg); color: var(--body); font: 400 16px/1.6 -apple-system, BlinkMacSystemFont, "SF Pro Text", Inter, "Segoe UI", Roboto, sans-serif; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 2px; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--link); outline-offset: 2px; border-radius: 6px; }
code { font: 0.86em/1.5 ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace; color: var(--ink); background: var(--fill); border-radius: 6px; padding: 1.5px 5px; overflow-wrap: anywhere; }
svg { flex: none; }
.skip { position: absolute; left: -999px; top: 8px; z-index: 50; background: var(--pill-bg); color: var(--pill-ink); padding: 8px 14px; border-radius: 999px; }
.skip:focus { left: 12px; }

/* Bilah atas: kaca buram seperti bilah navigasi iOS */
.top { position: sticky; top: 0; z-index: 30; height: var(--top); display: flex; align-items: center; gap: 24px; padding: 0 20px; background: var(--bar); -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px); border-bottom: 0.5px solid var(--line); }
.logo { display: flex; align-items: center; gap: 8px; color: var(--ink); white-space: nowrap; }
.logo:hover { text-decoration: none; }
.logo img { display: block; border-radius: 6px; }
:root[data-theme="dark"] .logo img { filter: invert(1); }
.logo-word { font-size: 17px; font-weight: 700; letter-spacing: -0.3px; }
.logo-sub { color: var(--muted); font-size: 17px; font-weight: 500; letter-spacing: -0.2px; }
.tabs { display: flex; gap: 2px; }
.tab { color: var(--muted); font-size: 14px; font-weight: 500; padding: 6px 12px; border-radius: 999px; white-space: nowrap; }
.tab:hover { color: var(--ink); background: var(--hover); text-decoration: none; }
.tab.on { color: var(--ink); background: var(--active); }
.top-right { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.search-btn { display: flex; align-items: center; gap: 8px; height: 34px; padding: 0 10px 0 11px; min-width: 210px; border: 0; border-radius: 10px; background: var(--fill); color: var(--faint); font-size: 14px; cursor: pointer; margin-right: 4px; }
.search-btn:hover { background: var(--fill-2); }
.search-btn kbd { margin-left: auto; font: 500 11.5px/1 inherit; font-family: inherit; color: var(--faint); }
.icon-btn { width: 36px; height: 36px; display: grid; place-items: center; border: 0; border-radius: 999px; background: none; color: var(--muted); cursor: pointer; }
.icon-btn:hover { background: var(--hover); color: var(--ink); }
.lang-btn { display: flex; align-items: center; gap: 6px; height: 34px; padding: 0 10px; border-radius: 999px; color: var(--muted); font-size: 13.5px; font-weight: 500; white-space: nowrap; }
.lang-btn:hover { background: var(--hover); color: var(--ink); text-decoration: none; }
.menu-btn { display: none; }
.menu-btn .i-close, .menu-open .menu-btn svg:first-child { display: none; }
.menu-open .menu-btn svg:last-child { display: block; }
.menu-btn svg:last-child { display: none; }
.pill { display: inline-block; background: var(--pill-bg); color: var(--pill-ink); font-size: 14px; font-weight: 600; height: 34px; line-height: 34px; padding: 0 16px; border-radius: 999px; white-space: nowrap; margin-left: 6px; }
.pill:hover { text-decoration: none; opacity: 0.86; }

/* Ikon tema: yang tampil = pilihan sekarang */
.theme { position: relative; }
.theme-btn svg { display: none; }
[data-theme-pref="system"] .theme-btn .i-system, [data-theme-pref="light"] .theme-btn .i-light, [data-theme-pref="dark"] .theme-btn .i-dark { display: block; }

/* Menu konteks gaya macOS / iOS */
.menu { position: absolute; right: 0; top: calc(100% + 8px); z-index: 40; min-width: 200px; padding: 5px; background: var(--menu); -webkit-backdrop-filter: saturate(180%) blur(24px); backdrop-filter: saturate(180%) blur(24px); border-radius: 13px; box-shadow: var(--shadow); transform-origin: top right; animation: menu-in 0.16s ease-out; }
.menu[hidden] { display: none; }
@keyframes menu-in { from { opacity: 0; transform: scale(0.96); } to { opacity: 1; transform: none; } }
.menu a, .menu button { display: flex; align-items: center; gap: 10px; width: 100%; height: 34px; padding: 0 10px; border: 0; border-radius: 8px; background: none; color: var(--ink); font-size: 14px; text-align: left; cursor: pointer; white-space: nowrap; }
.menu a:hover, .menu button:hover { background: var(--hover); text-decoration: none; }
.menu svg { color: var(--muted); }
.menu .i-check { display: none; margin-left: auto; color: var(--link); }
.menu [aria-checked="true"] .i-check { display: block; }

/* Kerangka */
.shell { display: flex; align-items: flex-start; max-width: 1560px; margin: 0 auto; }
.side { position: sticky; top: var(--top); width: 264px; flex: none; height: calc(100vh - var(--top)); overflow-y: auto; padding: 24px 12px 40px 16px; scrollbar-width: none; }
.side::-webkit-scrollbar { display: none; }
.side-tabs, .side-extra { display: none; }
.nav-group { margin-bottom: 20px; }
.nav-title { color: var(--faint); font-size: 12.5px; font-weight: 600; margin: 0 0 4px; padding: 0 10px; }
.nav-item { display: flex; align-items: center; color: var(--body); font-size: 14px; line-height: 20px; padding: 6px 10px; border-radius: 8px; }
.nav-item .i-chev { display: none; }
.nav-item:hover { background: var(--hover); text-decoration: none; }
.nav-item.on { background: var(--active); color: var(--ink); font-weight: 600; }
.main { flex: 1; min-width: 0; max-width: 820px; padding: 44px 48px 72px; }
.toc { position: sticky; top: calc(var(--top) + 44px); width: 216px; flex: none; padding-left: 16px; margin-top: 44px; font-size: 13px; line-height: 18px; }
.toc p { color: var(--ink); font-weight: 600; margin: 0 0 8px; }
.toc a { display: block; color: var(--muted); padding: 5px 0 5px 12px; margin-left: -12px; border-left: 2px solid transparent; }
.toc a:hover { color: var(--ink); text-decoration: none; }
.toc a.on { color: var(--ink); font-weight: 600; border-left-color: var(--ink); }

/* Kepala halaman */
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; margin-bottom: 32px; }
.crumb { color: var(--muted); font-size: 14px; font-weight: 500; margin: 0 0 8px; }
h1 { color: var(--ink); font-size: 36px; line-height: 1.12; font-weight: 700; letter-spacing: -0.8px; margin: 0; }
.sub { font-size: 18px; line-height: 1.5; margin: 12px 0 0; color: var(--muted); }
.page-menu { position: relative; display: flex; flex: none; margin-top: 4px; background: var(--fill); border-radius: 999px; }
.page-menu > button { display: flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border: 0; background: none; color: var(--ink); font-size: 13px; font-weight: 500; cursor: pointer; border-radius: 999px; }
.page-menu > button:hover { background: var(--fill-2); }
.pm-copy { padding-right: 8px !important; }
.pm-more { padding: 0 10px 0 6px !important; color: var(--muted) !important; }
.pm-list { min-width: 220px; }

/* Isi */
.prose h2 { color: var(--ink); font-size: 24px; line-height: 1.25; font-weight: 700; letter-spacing: -0.4px; margin: 48px 0 12px; }
.prose h3 { color: var(--ink); font-size: 17px; line-height: 1.4; font-weight: 600; margin: 30px 0 6px; }
.prose p { margin: 0 0 16px; }
.prose ul, .prose ol { margin: 0 0 16px; padding-left: 22px; }
.prose li { margin-bottom: 6px; }
.prose li::marker { color: var(--faint); }
.prose strong { color: var(--ink); font-weight: 600; }
.note { background: var(--fill); border-radius: 14px; padding: 14px 18px; margin: 0 0 20px; font-size: 15px; }
.table { overflow-x: auto; margin: 0 0 24px; }
table { border-collapse: collapse; width: 100%; font-size: 15px; line-height: 1.5; }
th { color: var(--muted); font-size: 13px; font-weight: 600; text-align: left; padding: 0 16px 8px 0; white-space: nowrap; border-bottom: 0.5px solid var(--line); }
td { padding: 11px 16px 11px 0; border-bottom: 0.5px solid var(--line); vertical-align: top; }
td:last-child, th:last-child { padding-right: 0; }
td code { overflow-wrap: normal; }
td:first-child code { white-space: nowrap; }
tr:target td { background: var(--hover); }

/* Kode: satu bidang abu, tab bahasa = segmented control iOS */
.code { background: var(--fill); border-radius: 14px; margin: 0 0 20px; overflow: hidden; }
.code-head { display: flex; align-items: center; min-height: 44px; padding: 0 8px 0 10px; }
.code-title { color: var(--muted); font-size: 13px; font-weight: 500; padding-left: 6px; }
.code-tabs { display: flex; gap: 2px; padding: 2px; background: var(--fill-2); border-radius: 9px; overflow-x: auto; scrollbar-width: none; }
.code-tab { height: 26px; padding: 0 11px; border: 0; border-radius: 7px; background: none; color: var(--muted); font-size: 12.5px; font-weight: 500; cursor: pointer; white-space: nowrap; transition: background 0.15s, color 0.15s; }
.code-tab:hover { color: var(--ink); }
.code-tab.on { color: var(--ink); background: var(--thumb); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 0 0 0.5px rgba(0, 0, 0, 0.04); font-weight: 600; }
.code-copy { margin-left: auto; flex: none; width: 30px; height: 30px; display: grid; place-items: center; border: 0; border-radius: 8px; background: none; color: var(--muted); cursor: pointer; }
.code-copy:hover { color: var(--ink); background: var(--fill-2); }
.code-copy .i-check, .code-copy.done svg:first-child { display: none; }
.code-copy.done .i-check { display: block; color: var(--get); }
.code-pane { display: none; margin: 0; padding: 4px 18px 16px; overflow-x: auto; }
.code-pane.on { display: block; }
.code-pane code { background: none; padding: 0; border-radius: 0; color: var(--ink); font-size: 13px; line-height: 1.65; overflow-wrap: normal; white-space: pre; }
.t-s { color: var(--t-s); } .t-k { color: var(--t-k); } .t-n { color: var(--t-n); } .t-c { color: var(--t-c); }

/* Referensi */
.layout-reference .main { max-width: 1180px; }
.ref { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 480px); gap: 48px; padding: 8px 0 36px; border-top: 0.5px solid var(--line); margin-top: 16px; }
.ref:first-of-type { margin-top: 28px; }
.ref-wide { grid-template-columns: minmax(0, 1fr); }
.ref h2 { margin-top: 24px; }
.ref-code { position: sticky; top: calc(var(--top) + 20px); align-self: start; margin-top: 24px; max-height: calc(100vh - var(--top) - 40px); overflow-y: auto; scrollbar-width: none; }
.endpoint { display: flex; align-items: center; gap: 10px; }
.endpoint code { background: none; padding: 0; font-size: 14.5px; }
.method { color: var(--get); background: var(--get-bg); font-size: 12px; font-weight: 700; letter-spacing: 0.2px; padding: 3px 8px; border-radius: 6px; }
.method-post { color: var(--post); background: var(--post-bg); }

/* Beranda: kartu = sel grup iOS */
.layout-home .main { max-width: 980px; padding-top: 64px; }
.layout-home h1 { font-size: 48px; letter-spacing: -1.4px; }
.home-head { margin-bottom: 36px; }
.home-head .sub { font-size: 20px; max-width: 640px; }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; margin: 0 0 28px; }
.card { display: flex; align-items: center; gap: 12px; padding: 16px 16px 16px 18px; background: var(--fill); border-radius: 16px; transition: background 0.15s; }
.card:hover { background: var(--fill-2); text-decoration: none; }
.card-body { flex: 1; min-width: 0; }
.card-title { display: block; color: var(--ink); font-size: 16px; font-weight: 600; margin-bottom: 3px; }
.card-text { display: block; color: var(--muted); font-size: 14px; line-height: 1.45; }
.card .i-chev { color: var(--faint); }

/* Kaki */
.pager { display: flex; justify-content: space-between; gap: 12px; margin-top: 56px; }
.pager-item { flex: 1; max-width: 48%; padding: 14px 18px; background: var(--fill); border-radius: 14px; color: var(--ink); font-size: 15px; font-weight: 600; }
.pager-item:hover { background: var(--fill-2); text-decoration: none; }
.pager-item span { display: block; color: var(--muted); font-size: 12.5px; font-weight: 500; margin-bottom: 2px; }
.pager-item.next { text-align: right; }
.foot { margin-top: 48px; padding-top: 20px; border-top: 0.5px solid var(--line); color: var(--muted); font-size: 13.5px; }
.foot p { margin: 0 0 10px; }
.foot-links { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.foot-links a { color: var(--muted); }
.foot-links a:hover { color: var(--ink); }
.foot-copy { color: var(--faint); font-size: 12.5px; }

/* Cari: gaya Spotlight */
dialog.search { width: min(600px, calc(100vw - 32px)); padding: 0; margin-top: 12vh; border: 0; border-radius: 18px; background: var(--menu); -webkit-backdrop-filter: saturate(180%) blur(30px); backdrop-filter: saturate(180%) blur(30px); color: var(--body); box-shadow: var(--shadow); }
dialog.search[open] { animation: menu-in 0.18s ease-out; }
dialog.search::backdrop { background: rgba(0, 0, 0, 0.32); }
.search-field { display: flex; align-items: center; gap: 10px; padding: 0 18px; border-bottom: 0.5px solid var(--line); color: var(--faint); }
.search-field svg { width: 20px; height: 20px; }
.search-box input { flex: 1; min-width: 0; height: 56px; border: 0; outline: 0; background: none; color: var(--ink); font: inherit; font-size: 19px; }
.search-box input::-webkit-search-cancel-button { display: none; }
.search-list { max-height: 52vh; overflow-y: auto; padding: 6px; }
.search-list a { display: block; padding: 9px 12px; border-radius: 10px; color: var(--body); }
.search-list a:hover, .search-list a.sel { background: var(--link); text-decoration: none; }
.search-list a:hover strong, .search-list a:hover span, .search-list a.sel strong, .search-list a.sel span { color: #fff; }
.search-list strong { display: block; color: var(--ink); font-size: 15px; font-weight: 600; }
.search-list span { display: block; color: var(--muted); font-size: 13px; line-height: 1.35; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.search-list p { color: var(--muted); padding: 14px 12px; margin: 0; font-size: 14px; }

@media (prefers-reduced-motion: reduce) {
  .menu, dialog.search[open] { animation: none; }
}
@media (max-width: 1320px) {
  .toc { display: none; }
}
@media (max-width: 1180px) {
  .ref { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .ref-code { position: static; max-height: none; margin-top: 8px; }
  .search-btn { min-width: 160px; }
}
@media (max-width: 1040px) {
  .lang-btn span { display: none; }
}
/* HP dan tablet: menu = daftar berkelompok gaya Pengaturan iOS */
@media (max-width: 900px) {
  :root { --top: 52px; }
  .top { gap: 6px; padding: 0 8px 0 6px; }
  .tabs, .top-right > .pill, .top-right > .lang-btn, .search-btn span, .search-btn kbd { display: none; }
  .menu-btn { display: grid; }
  .logo { margin-right: auto; }
  .logo-word, .logo-sub { font-size: 16.5px; }
  .search-btn { min-width: 0; width: 36px; height: 36px; justify-content: center; padding: 0; margin: 0; border-radius: 999px; background: none; color: var(--muted); }
  .shell { display: block; }
  .side { position: fixed; top: var(--top); left: 0; right: 0; bottom: 0; z-index: 25; width: auto; height: auto; padding: 16px 16px calc(40px + env(safe-area-inset-bottom)); background: var(--fill); display: none; }
  :root[data-theme="dark"] .side { background: var(--bg); }
  .menu-open .side { display: block; }
  .menu-open { overflow: hidden; }
  .side-tabs { display: flex; gap: 2px; padding: 2px; margin-bottom: 22px; background: var(--fill-2); border-radius: 10px; }
  .side-tabs .tab { flex: 1; text-align: center; padding: 7px 8px; border-radius: 8px; font-size: 13.5px; }
  .side-tabs .tab.on { background: var(--thumb); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1); color: var(--ink); font-weight: 600; }
  .nav-group, .side-extra { margin-bottom: 24px; }
  .side-extra { display: block; }
  .nav-title { font-size: 13px; font-weight: 400; color: var(--muted); padding: 0 16px; margin-bottom: 6px; }
  .nav-list { background: var(--bg); border-radius: 12px; overflow: hidden; }
  :root[data-theme="dark"] .nav-list { background: var(--fill); }
  .nav-item { min-height: 46px; padding: 0 14px 0 16px; border-radius: 0; font-size: 16px; color: var(--ink); position: relative; }
  .nav-item span { flex: 1; }
  .nav-item .i-chev { display: block; color: var(--faint); }
  .nav-item + .nav-item::before { content: ""; position: absolute; top: 0; left: 16px; right: 0; border-top: 0.5px solid var(--line); }
  .nav-item.on { background: none; font-weight: 600; color: var(--link); }
  .nav-item:hover { background: var(--hover); }
  .lang-row svg:first-child { margin-right: 10px; color: var(--muted); }
  .side-pill { display: block; text-align: center; height: 48px; line-height: 48px; margin: 8px 0 0; font-size: 16px; }
  .main { padding: 28px 20px 56px; }
  h1 { font-size: 30px; letter-spacing: -0.6px; }
  .layout-home h1 { font-size: 36px; letter-spacing: -1px; }
  .layout-home .main { padding-top: 36px; }
  .home-head .sub { font-size: 18px; }
  .page-head { display: block; }
  .page-menu { display: inline-flex; margin-top: 18px; }
  .pm-list { left: 0; right: auto; transform-origin: top left; }
  .sub { font-size: 17px; }
  .prose h2 { font-size: 22px; margin-top: 40px; }
  .code { margin-left: -20px; margin-right: -20px; border-radius: 0; }
  .ref-code .code { margin-left: -20px; margin-right: -20px; }
  .cards { gap: 0; background: var(--fill); border-radius: 14px; overflow: hidden; grid-template-columns: 1fr; }
  .card { border-radius: 0; background: none; position: relative; padding: 13px 14px 13px 16px; }
  .card + .card::before { content: ""; position: absolute; top: 0; left: 16px; right: 0; border-top: 0.5px solid var(--line); }
  .pager-item { padding: 12px 14px; }
  .theme-list { right: -2px; }
}
