/* =========================================================================
   JIJI — style.css
   v2 — Tulisan: Plus Jakarta Sans (enak dibaca). Maskot pixel SNES yang
   diperbesar tajam, ikon garis, palet navy + aksen oranye (v3, selaras ikon aplikasi).
   ========================================================================= */

:root {
  --bg: #FFFFFF;
  --bg-side: #F5F7FB;
  --surface: #FFFFFF;
  --surface-2: #F1F4F9;
  --line: #E3E8F0;
  --line-strong: #CED6E3;
  --text: #0F1B33;
  --text-2: #4A5672;
  --text-3: #8590A6;
  --accent: #F26B1D;
  --accent-ink: #FFFFFF;
  --accent-soft: #FFF2E9;
  --accent-deep: #C4520E;
  --accent-text: #C4520E;
  --mint: #16A37F;
  --mint-soft: #E3F6F0;
  --danger: #DC3B26;
  --danger-soft: #FDECEA;
  --user-bubble: #EEF2F8;
  --code-bg: #0B1324;
  --code-text: #EDEDED;
  --shadow: 0 1px 2px rgba(0, 0, 0, .04), 0 8px 28px rgba(0, 0, 0, .07);
  --shadow-lg: 0 2px 6px rgba(0, 0, 0, .05), 0 24px 60px rgba(0, 0, 0, .12);
  --pixel-shadow: 0 1px 1px rgba(0, 0, 0, .06), 0 6px 16px -4px rgba(242, 107, 29, .45);
  --glow: 0 0 0 4px rgba(242, 107, 29, .14);
  --radius: 14px;
  --radius-lg: 22px;
  --side-w: 272px;
  --col: 760px;
  --ease: cubic-bezier(.2, .7, .2, 1);
  --font: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-display: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0B1324; --bg-side: #0E172B; --surface: #121C33; --surface-2: #18233D;
    --line: #1F2B47; --line-strong: #2B3A5C; --text: #F2F4F8; --text-2: #A8B3C7; --text-3: #74819A;
    --accent: #FF7A2E; --accent-ink: #000000; --accent-soft: rgba(255, 122, 46, .13); --accent-deep: #C4520E; --accent-text: #FF9A5C;
    --mint: #34D3A6; --mint-soft: rgba(52, 211, 166, .12); --danger: #FF6B57; --danger-soft: rgba(255, 107, 87, .12);
    --user-bubble: #18233D; --code-bg: #081020; --code-text: #EDEDED;
    --shadow: 0 1px 2px rgba(0, 0, 0, .6), 0 10px 30px rgba(0, 0, 0, .6);
    --shadow-lg: 0 2px 6px rgba(0, 0, 0, .6), 0 24px 60px rgba(0, 0, 0, .7);
    --glow: 0 0 0 4px rgba(255, 122, 46, .18);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0B1324; --bg-side: #0E172B; --surface: #121C33; --surface-2: #18233D;
  --line: #1F2B47; --line-strong: #2B3A5C; --text: #F2F4F8; --text-2: #A8B3C7; --text-3: #74819A;
  --accent: #FF7A2E; --accent-ink: #000000; --accent-soft: rgba(255, 122, 46, .13); --accent-deep: #C4520E; --accent-text: #FF9A5C;
  --mint: #34D3A6; --mint-soft: rgba(52, 211, 166, .12); --danger: #FF6B57; --danger-soft: rgba(255, 107, 87, .12);
  --user-bubble: #18233D; --code-bg: #081020; --code-text: #EDEDED;
  --shadow: 0 1px 2px rgba(0, 0, 0, .6), 0 10px 30px rgba(0, 0, 0, .6);
  --shadow-lg: 0 2px 6px rgba(0, 0, 0, .6), 0 24px 60px rgba(0, 0, 0, .7);
  --glow: 0 0 0 4px rgba(255, 122, 46, .18);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 16px/1.65 var(--font);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow: hidden;
}
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--accent-text); }
img.px, .px, .px img { image-rendering: auto; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.is-hidden { display: none !important; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 8px; }
.skip { position: absolute; left: -999px; top: 8px; z-index: 99; background: var(--surface); padding: 8px 12px; border-radius: 8px; }
.skip:focus { left: 8px; }

/* Ikon pixel (SVG dari app.js) */
.modal svg, .btn svg, .menu svg, [data-icon] svg, .ico { width: 18px; height: 18px; display: block; }

/* ------------------------------------------------------------ LAYOUT */
.app { display: flex; height: 100dvh; width: 100%; }

.side {
  width: var(--side-w);
  flex: none;
  background: var(--bg-side);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  /* Safe area: notch/Dynamic Island & home indicator di iPhone (viewport-fit=cover). */
  padding: calc(12px + env(safe-area-inset-top)) 10px calc(10px + env(safe-area-inset-bottom)) calc(10px + env(safe-area-inset-left));
  gap: 10px;
  transition: transform .28s var(--ease);
}
.side__top { display: flex; align-items: center; justify-content: space-between; padding: 2px 6px; }
.side .side__close { display: none; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); }
.brand__cat { width: 32px; height: 32px; border-radius: 9px; background: var(--accent-soft); }
.brand__name { font: 800 21px/1 var(--font-display); letter-spacing: -.02em; }

a.btn { text-decoration: none; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--text);
  border-radius: 12px; padding: 9px 14px; font-weight: 600; font-size: 15px;
  transition: background .15s, transform .08s, box-shadow .15s, border-color .15s;
}
.btn:hover { border-color: var(--text-3); }
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.btn--primary {
  background: var(--accent); border-color: var(--accent); color: var(--accent-ink);
  box-shadow: var(--pixel-shadow);
}
.btn--primary:hover { border-color: var(--accent); filter: brightness(1.05); }
.btn--primary:active { transform: translateY(1px); }
.btn--ghost { background: transparent; border-color: transparent; }
.btn--ghost:hover { background: var(--surface-2); border-color: transparent; }
.btn--danger { color: var(--danger); }
.btn--danger-fill { background: var(--danger); border-color: var(--danger); color: #fff; box-shadow: none; }
.btn--wide { width: 100%; }
/* Sign in with Apple — hitam/putih sesuai pedoman Apple, terpisah dari tema aksen JIJI. */
.btn--apple { background: #000; border-color: #000; color: #fff; font-size: 17px; border-radius: 10px; }
.btn--apple:hover { border-color: #000; filter: brightness(1.15); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .btn--apple { background: #fff; border-color: #fff; color: #000; } }
:root[data-theme="dark"] .btn--apple { background: #fff; border-color: #fff; color: #000; }
.btn--new { justify-content: flex-start; background: var(--surface); }

.icon-btn {
  display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 10px;
  border: 0; background: transparent; color: var(--text-2); transition: background .15s, color .15s;
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); }

/* Daftar obrolan */
.convs { flex: 1; overflow-y: auto; margin: 0 -4px; padding: 0 4px; scrollbar-width: thin; }
.convs__group { font-size: 12px; font-weight: 600; color: var(--text-3); padding: 12px 10px 4px; text-transform: uppercase; letter-spacing: .04em; }
.conv {
  position: relative; display: flex; align-items: center; border-radius: 10px;
  transition: background .12s;
}
.conv:hover, .conv.is-active { background: var(--surface-2); }
.conv.is-active { background: var(--accent-soft); }
.conv__link {
  flex: 1; min-width: 0; padding: 8px 10px; text-decoration: none; color: var(--text);
  font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.conv__more { opacity: 0; width: 30px; height: 30px; margin-right: 4px; }
.conv:hover .conv__more, .conv.is-active .conv__more, .conv__more:focus-visible { opacity: 1; }
@media (hover: none) { .conv__more { opacity: .7; } }
.convs__empty { color: var(--text-3); font-size: 14px; padding: 12px 10px; }

.menu {
  position: fixed; z-index: 40; min-width: 180px; background: var(--surface); border: 1px solid var(--line);
  border-radius: 12px; box-shadow: var(--shadow); padding: 6px; animation: pop .14s var(--ease);
}
.menu button { display: flex; width: 100%; gap: 10px; align-items: center; border: 0; background: none; padding: 8px 10px; border-radius: 8px; font-size: 14.5px; text-align: left; }
.menu button:hover { background: var(--surface-2); }
.menu .danger { color: var(--danger); }

.side__foot { display: flex; flex-direction: column; gap: 8px; }
.plus-card {
  display: flex; gap: 10px; align-items: center; text-align: left; width: 100%;
  border: 1px solid var(--accent); background: var(--accent-soft); color: var(--text);
  border-radius: 12px; padding: 10px 12px; transition: transform .12s;
}
.plus-card:hover { transform: translateY(-1px); }
.plus-card strong { display: block; font-size: 14.5px; }
.plus-card small { color: var(--text-2); font-size: 12.5px; }
.plus-card__icon { color: var(--accent); }
.side-link { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; color: var(--text); text-decoration: none; font-size: 14.5px; }
.side-link:hover { background: var(--surface-2); }
.side-link svg { width: 18px; height: 18px; color: var(--text-2); }
.cpick { list-style: none; margin: 10px 0 0; padding: 0; max-height: min(52vh, 420px); overflow-y: auto; border: 1px solid var(--line); border-radius: 12px; }
.cpick li + li { border-top: 1px solid var(--line); }
.cpick__f { display: flex; width: 100%; gap: 10px; align-items: center; border: 0; background: none; padding: 10px 12px; text-align: left; color: var(--text); }
.cpick__f:hover, .cpick__f:focus-visible { background: var(--surface-2); }
.cpick__f svg { width: 20px; height: 20px; flex: none; color: var(--text-2); }
.cpick__t { display: flex; flex-direction: column; min-width: 0; }
.cpick__t b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cpick__t small { color: var(--text-2); font-size: 12.5px; }
.me { display: flex; align-items: center; gap: 10px; }
.me__btn { flex: 1; display: flex; align-items: center; gap: 10px; min-width: 0; border: 0; background: none; padding: 6px 8px; border-radius: 10px; text-align: left; }
.me__btn:hover { background: var(--surface-2); }
.me__pic { width: 32px; height: 32px; border-radius: 50%; flex: none; background: var(--accent-soft); object-fit: cover; }
.me__txt { min-width: 0; }
.me__name { display: block; font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me__plan { display: block; font-size: 12px; color: var(--text-3); }
.legal { display: flex; flex-wrap: wrap; gap: 4px 12px; padding: 4px 8px 2px; font-size: 12px; }
.legal a { color: var(--text-3); text-decoration: none; }
.legal a:hover { color: var(--text); }

.badge { display: inline-block; font: 700 10.5px/1 var(--font-display); letter-spacing: .08em; padding: 3px 6px; border-radius: 5px; background: var(--surface-2); color: var(--text-2); vertical-align: middle; }
.badge--plus { background: var(--accent); color: var(--accent-ink); }

/* ------------------------------------------------------------ MAIN */
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; position: relative; }
.bar {
  display: flex; align-items: center; gap: 8px; height: calc(56px + env(safe-area-inset-top)); padding: env(safe-area-inset-top) 14px 0; flex: none;
  border-bottom: 1px solid transparent; transition: border-color .2s;
}
.bar.is-scrolled { border-bottom-color: var(--line); }
.bar__menu { display: inline-grid; }
@media (min-width: 861px) {
  .app.is-collapsed .side { display: none; }
  .app:not(.is-collapsed) .bar__menu { display: none; }
}
.bar__title {
  border: 0; background: none; font-weight: 600; font-size: 15.5px; padding: 6px 10px; border-radius: 10px;
  max-width: min(60vw, 520px); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text);
}
.bar__title:hover { background: var(--surface-2); }
.bar__right { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.quota {
  font-size: 13px; color: var(--text-2); padding: 4px 10px; border-radius: 999px; background: var(--surface-2);
  border: 0; white-space: nowrap;
}
.quota.is-low { background: var(--accent-soft); color: var(--accent-text); }

.offline { text-align: center; font-size: 14px; background: var(--danger-soft); color: var(--danger); padding: 6px 12px; }

.scroller { flex: 1; overflow-y: auto; overscroll-behavior: contain; scroll-behavior: auto; }
.thread { max-width: var(--col); margin: 0 auto; padding: 8px 20px 24px; }

/* Sambutan */
.hello {
  position: relative; isolation: isolate;
  max-width: var(--col); margin: 0 auto; padding: min(9vh, 72px) 20px 16px; text-align: center;
  animation: rise .45s var(--ease);
}
.hello::before {
  content: ''; position: absolute; z-index: -1; left: 50%; top: min(4vh, 32px); width: 420px; height: 260px;
  transform: translateX(-50%); border-radius: 50%; pointer-events: none;
  background: radial-gradient(closest-side, rgba(242, 107, 29, .16), rgba(242, 107, 29, 0));
  filter: blur(8px);
}
.caps { list-style: none; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; padding: 0; margin: -8px 0 26px; }
.caps li {
  display: inline-flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 500; color: var(--text-2);
  border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 5px 12px 5px 10px;
}
.caps li span[data-icon] { color: var(--accent-text); }
.caps svg { width: 13px; height: 13px; }
.hello__stage { position: relative; width: 120px; height: 120px; margin: 0 auto 8px; }
.hello__stage::after {
  content: ''; position: absolute; left: 50%; bottom: 2px; width: 84px; height: 10px; transform: translateX(-50%);
  border-radius: 50%; background: rgba(0, 0, 0, .10); filter: blur(3px); animation: shadow 4s ease-in-out infinite;
}
.hello__cat { position: relative; z-index: 1; width: 120px; height: 120px; display: block; animation: bob 4s ease-in-out infinite; }
.hello__title { font-size: clamp(28px, 3.4vw, 38px); line-height: 1.15; letter-spacing: -.03em; margin: 0 0 10px; font-weight: 750; text-wrap: balance; }
.hello__lead { font-size: 16.5px; color: var(--text-2); margin: 0 auto 20px; max-width: 540px; text-wrap: pretty; }
.hello__cta { max-width: var(--col); margin: 14px auto 0; font-size: 13.5px; color: var(--text-3); text-align: center; }
.starters { max-width: var(--col); margin: 14px auto 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; text-align: left; }
.starter {
  display: flex; gap: 12px; align-items: flex-start; border: 1px solid var(--line); background: var(--surface);
  border-radius: var(--radius); padding: 14px; transition: border-color .15s, transform .15s, box-shadow .15s;
  text-align: left; width: 100%;
}
.starter:hover { border-color: color-mix(in srgb, var(--accent) 55%, var(--line)); transform: translateY(-2px); box-shadow: var(--shadow); }
.starter .starter__ico { flex: none; width: 36px; height: 36px; display: grid; place-items: center; border-radius: 10px; background: var(--accent-soft); color: var(--accent-text); }
.starter__ico svg { width: 20px; height: 20px; }
.starter b { display: block; font-size: 15px; }
.starter__txt { min-width: 0; }
.starter__txt span { display: block; font-size: 13.5px; color: var(--text-2); line-height: 1.45; }

/* Pesan */
.msg { display: flex; gap: 14px; padding: 12px 0; animation: rise .28s var(--ease); }
.msg--user { justify-content: flex-end; flex-wrap: wrap; }
.msg--user .msg__actions { width: 100%; justify-content: flex-end; margin-top: 2px; }
.editing .composer { border-color: var(--mint); }
.edit-bar { max-width: var(--col); margin: 0 auto 6px; display: flex; align-items: center; justify-content: space-between; font-size: 13.5px; color: var(--text-2); padding: 0 6px; }
.edit-bar button { border: 0; background: none; color: var(--accent-deep); font-weight: 600; font-size: 13.5px; }
.msg--user .msg__body {
  background: var(--user-bubble); padding: 10px 16px; border-radius: 18px 18px 6px 18px;
  max-width: min(85%, 600px); white-space: pre-wrap; overflow-wrap: anywhere;
}
.msg__avatar {
  width: 32px; height: 32px; flex: none; border-radius: 10px; overflow: hidden; margin-top: -3px;
  background: var(--accent-soft); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 22%, transparent);
}
.msg__avatar img { width: 100%; height: 100%; display: block; }
.msg__main { min-width: 0; flex: 1; }
.msg--ai .msg__body { overflow-wrap: anywhere; }
.msg__body > :first-child { margin-top: 0; }
.msg__body > :last-child { margin-bottom: 0; }
.msg__body p { margin: 0 0 .85em; }
.msg__body ul, .msg__body ol { margin: 0 0 .9em; padding-left: 1.4em; }
.msg__body li { margin: .25em 0; }
.msg__body h3 { font-size: 1.08em; margin: 1.1em 0 .5em; }
.msg__body blockquote { margin: 0 0 .9em; padding: 2px 0 2px 14px; border-left: 3px solid var(--line-strong); color: var(--text-2); }
.msg__body code { font: 0.88em var(--font-mono); background: var(--surface-2); padding: .12em .38em; border-radius: 6px; }
.code { position: relative; margin: 0 0 1em; border-radius: 12px; overflow: hidden; background: var(--code-bg); }
.code__head { display: flex; align-items: center; justify-content: space-between; padding: 6px 8px 6px 14px; font: 12.5px var(--font-mono); color: #A1A1AA; background: rgba(255,255,255,.05); }
.code__head button { border: 0; background: none; color: inherit; display: inline-flex; gap: 6px; align-items: center; font: 12.5px var(--font); padding: 4px 8px; border-radius: 6px; }
.code__head button:hover { background: rgba(255,255,255,.1); color: #fff; }
.code__head svg { width: 13px; height: 13px; }
.code pre { margin: 0 !important; border-radius: 0 !important; }
.msg__body pre { position: relative; background: var(--code-bg); color: var(--code-text); border-radius: 12px; padding: 14px 16px; overflow-x: auto; margin: 0 0 1em; font-size: 14px; line-height: 1.55; }
.msg__body pre code { background: none; padding: 0; color: inherit; font-size: inherit; }
.msg__body table { border-collapse: collapse; margin: 0 0 1em; font-size: 14.5px; display: block; overflow-x: auto; }
.msg__body th, .msg__body td { border: 1px solid var(--line); padding: 6px 10px; text-align: left; }
.msg__body hr { border: 0; border-top: 1px solid var(--line); margin: 1.2em 0; }
.msg__body a { word-break: break-word; }

.caret::after {
  content: ''; display: inline-block; width: 8px; height: 16px; margin-left: 3px; vertical-align: -2px;
  background: var(--accent); animation: blink 1s steps(2) infinite;
}
.thinking { display: inline-flex; align-items: center; gap: 5px; padding: 6px 0; color: var(--text-3); font-size: 14.5px; }
.thinking em { font-style: normal; margin-left: 6px; }
.thinking i { width: 7px; height: 7px; background: var(--accent); animation: hop 1s infinite; }
.thinking i:nth-child(2) { animation-delay: .15s; }
.thinking i:nth-child(3) { animation-delay: .3s; }

.msg__actions { display: flex; gap: 2px; margin-top: 6px; opacity: 0; transition: opacity .15s; }
.msg:hover .msg__actions, .msg:focus-within .msg__actions, .msg.is-last .msg__actions { opacity: 1; }
@media (hover: none) { .msg__actions { opacity: 1; } }
.act { display: inline-flex; align-items: center; gap: 6px; border: 0; background: none; color: var(--text-3); font-size: 13px; padding: 5px 8px; border-radius: 8px; }
.act:hover { background: var(--surface-2); color: var(--text); }
.act svg { width: 15px; height: 15px; }
.msg__note { font-size: 13px; color: var(--text-3); margin-top: 6px; }
.msg__error {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px; background: var(--danger-soft); color: var(--danger);
  border-radius: 12px; padding: 10px 14px; font-size: 14.5px;
}
.msg__error .btn { padding: 5px 12px; font-size: 14px; }

.gate {
  border: 1px solid var(--accent); background: var(--accent-soft); border-radius: var(--radius-lg);
  padding: 20px; display: flex; gap: 16px; align-items: center; margin: 12px 0; animation: rise .3s var(--ease);
}
.gate img { width: 64px; height: 64px; flex: none; }
.gate h3 { margin: 0 0 4px; font-size: 17px; }
.gate p { margin: 0 0 12px; color: var(--text-2); font-size: 14.5px; }

.to-bottom {
  position: absolute; left: 50%; transform: translateX(-50%); bottom: 150px; z-index: 5;
  width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface);
  box-shadow: var(--shadow); display: grid; place-items: center; color: var(--text-2);
  animation: pop .18s var(--ease);
}

/* Composer */
.dock { flex: none; padding: 0 16px calc(10px + env(safe-area-inset-bottom)); }
.composer {
  max-width: var(--col); margin: 0 auto; background: var(--surface); border: 1px solid var(--line-strong);
  border-radius: var(--radius-lg); box-shadow: var(--shadow); padding: 12px 12px 10px 16px;
  transition: border-color .15s, box-shadow .15s;
}
.composer:focus-within { border-color: var(--accent); box-shadow: var(--shadow), var(--glow); }
.composer textarea {
  width: 100%; border: 0; outline: 0; resize: none; background: transparent; font-size: 16px; line-height: 1.55;
  max-height: 40vh; min-height: 26px; padding: 2px 0; display: block;
}
.composer textarea::placeholder { color: var(--text-3); }
.composer__row { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.modes { display: flex; gap: 4px; flex-wrap: wrap; flex: 1; min-width: 0; }
.mode {
  display: inline-flex; align-items: center; gap: 6px; border: 1px solid transparent; background: var(--surface-2);
  color: var(--text-2); border-radius: 999px; padding: 4px 11px 4px 8px; font-size: 13.5px; font-weight: 500;
  transition: background .15s, color .15s, border-color .15s;
}
.mode svg { width: 15px; height: 15px; }
.mode:hover { color: var(--text); }
.mode[aria-checked="true"] { background: var(--accent-soft); color: var(--accent-text); border-color: var(--accent); }
.send {
  flex: none; width: 38px; height: 38px; border-radius: 12px; border: 0; background: var(--accent); color: var(--accent-ink);
  display: grid; place-items: center; box-shadow: var(--pixel-shadow); transition: transform .08s, opacity .15s, box-shadow .08s;
}
.send:active { transform: scale(.96); }
.send[disabled] { opacity: .35; cursor: default; box-shadow: none; }
.send--stop { background: var(--text); color: var(--bg); box-shadow: none; }
.dock__note { text-align: center; font-size: 12.5px; color: var(--text-3); margin: 8px 0 0; }

/* ------------------------------------------------------------ LAMPIRAN */
.attach { flex: none; width: 34px; height: 34px; border-radius: 10px; color: var(--text-2); }
.attach:hover { color: var(--accent-text); background: var(--accent-soft); }
.tray { display: flex; gap: 8px; flex-wrap: wrap; padding: 2px 0 10px; }
.att {
  position: relative; display: flex; align-items: center; gap: 10px; min-width: 0; max-width: 240px;
  border: 1px solid var(--line); background: var(--surface-2); border-radius: 12px; padding: 6px 30px 6px 6px;
  animation: pop .18s var(--ease);
}
.att--image { padding: 0; width: 64px; height: 64px; overflow: hidden; }
.att--image.is-loading { width: auto; height: auto; padding: 6px 30px 6px 6px; }
.att img { width: 100%; height: 100%; object-fit: cover; display: block; }
.att__doc, .att__ph {
  flex: none; width: 36px; height: 36px; border-radius: 9px; display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent-text);
}
.att__txt { min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.att__txt b { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.att__txt small { font-size: 11.5px; color: var(--text-3); }
.att.is-loading .att__doc, .att.is-loading .att__ph { animation: pulse 1s ease-in-out infinite; }
.att__x {
  position: absolute; top: 4px; right: 4px; width: 22px; height: 22px; border-radius: 50%; border: 0;
  display: grid; place-items: center; background: rgba(0, 0, 0, .55); color: #fff; padding: 0;
}
.att__x svg { width: 10px; height: 10px; }
.att--doc .att__x { background: transparent; color: var(--text-3); top: 50%; transform: translateY(-50%); }
.att--doc .att__x:hover { color: var(--text); }
.msg__atts { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; width: 100%; margin-bottom: 6px; }
.att-img {
  display: block; width: 168px; height: 168px; border-radius: 16px; overflow: hidden; border: 1px solid var(--line);
  background: var(--surface-2);
}
.att-img img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .3s var(--ease); }
.att-img:hover img { transform: scale(1.03); }
.msg__atts .att { padding-right: 12px; background: var(--surface); }
.main.is-drop::after {
  content: attr(data-drop); position: absolute; inset: 12px; z-index: 20; border-radius: 24px;
  border: 2px dashed var(--accent); background: color-mix(in srgb, var(--bg) 82%, transparent);
  display: grid; place-items: center; font-weight: 600; font-size: 17px; color: var(--accent-text);
  backdrop-filter: blur(4px); pointer-events: none;
}

/* ------------------------------------------------------------ RUMUS */
.math--display { display: block; overflow-x: auto; overflow-y: hidden; margin: .4em 0 1em; padding: 4px 0; text-align: center; }
.math--raw { font-family: var(--font-mono); font-size: .9em; color: var(--text-2); }
.msg__body .katex { font-size: 1.08em; }

/* ------------------------------------------------------------ SUMBER WEB */
.sources { margin: 14px 0 4px; }
.sources__head { display: flex; align-items: center; gap: 7px; font-size: 12.5px; font-weight: 600; color: var(--text-3); text-transform: uppercase; letter-spacing: .05em; margin-bottom: 8px; }
.sources__head svg { width: 13px; height: 13px; }
.sources__list { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; }
.source {
  display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text);
  border: 1px solid var(--line); background: var(--surface); border-radius: 12px; padding: 9px 12px;
  transition: border-color .15s, transform .15s, box-shadow .15s;
}
.source:hover { border-color: var(--accent); transform: translateY(-1px); box-shadow: var(--shadow); }
.source__n {
  flex: none; width: 22px; height: 22px; border-radius: 7px; display: grid; place-items: center;
  background: var(--surface-2); color: var(--text-2); font: 600 11.5px/1 var(--font-mono);
}
.source__txt { min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.source__txt b { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.source__txt small { font-size: 11.5px; color: var(--text-3); }
.thinking.is-search i { background: var(--mint); }

/* ------------------------------------------------------------ MODAL */
.modal { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: max(16px, env(safe-area-inset-top)) 16px max(16px, env(safe-area-inset-bottom)); }
.modal__scrim { position: absolute; inset: 0; background: rgba(0, 0, 0, .45); backdrop-filter: blur(2px); animation: fade .18s; }
.modal__card {
  position: relative; width: min(100%, 460px); max-height: calc(100dvh - 32px); overflow-y: auto;
  background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow); padding: 24px;
  animation: pop .2s var(--ease);
}
.modal__card--wide { width: min(100%, 640px); }
.modal__x { position: absolute; top: 12px; right: 12px; }
.modal h2 { margin: 0 0 6px; font-size: 21px; line-height: 1.3; letter-spacing: -.01em; }
.modal p { margin: 0 0 14px; color: var(--text-2); }
.modal__art { width: 72px; height: 72px; display: block; margin: 0 0 12px; }
.modal__actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 18px; flex-wrap: wrap; }
.field { width: 100%; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--bg); padding: 10px 12px; font-size: 16px; }
.field:focus { outline: 0; border-color: var(--accent); }
.gsi { min-height: 44px; display: flex; justify-content: center; margin: 16px 0 6px; }
.fine { font-size: 12.5px; color: var(--text-3); margin-top: 12px; }

.plans { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 16px 0 4px; }
.plan { border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; display: flex; flex-direction: column; }
.plan--plus { border: 2px solid var(--accent); background: var(--accent-soft); }
.plan__name { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 16px; }
.plan__price { font-size: 26px; font-weight: 700; margin: 8px 0 2px; letter-spacing: -.02em; }
.plan__price small { font-size: 14px; font-weight: 500; color: var(--text-2); }
.plan ul { list-style: none; padding: 0; margin: 10px 0 14px; font-size: 14px; flex: 1; }
.plan li { display: flex; gap: 8px; align-items: flex-start; margin: 6px 0; }
.plan li svg { width: 14px; height: 14px; flex: none; margin-top: 4px; color: var(--mint); }

.meter { height: 10px; background: var(--surface-2); border-radius: 3px; overflow: hidden; margin: 8px 0 4px; }
.meter i { display: block; height: 100%; background: var(--accent); border-radius: 3px; transition: width .4s var(--ease);
  background-image: linear-gradient(90deg, transparent 50%, rgba(255,255,255,.18) 50%); background-size: 8px 100%; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; font-size: 14.5px; margin: 14px 0; }
.kv dt { color: var(--text-3); }
.kv dd { margin: 0; text-align: right; font-weight: 500; }
.panel-sec { border-top: 1px solid var(--line); padding-top: 16px; margin-top: 16px; }
.panel-sec h3 { font-size: 15px; margin: 0 0 8px; }
.who { display: flex; gap: 12px; align-items: center; }
.who img { width: 44px; height: 44px; border-radius: 50%; }
.who b { display: block; }
.who span { color: var(--text-2); font-size: 14px; }

.switch { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.switch input { appearance: none; width: 44px; height: 26px; border-radius: 999px; background: var(--line-strong); position: relative; transition: background .2s; flex: none; cursor: pointer; }
.switch input::after { content: ''; position: absolute; width: 20px; height: 20px; top: 3px; left: 3px; border-radius: 50%; background: #fff; transition: transform .2s var(--ease); }
.switch input:checked { background: var(--mint); }
.switch input:checked::after { transform: translateX(18px); }
.mems { list-style: none; padding: 0; margin: 12px 0; display: flex; flex-direction: column; gap: 6px; }
.mem { display: flex; gap: 8px; align-items: center; background: var(--surface-2); border-radius: 10px; padding: 8px 8px 8px 12px; font-size: 14.5px; }
.mem span { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.mem .field { padding: 6px 8px; font-size: 15px; }
.add-mem { display: flex; gap: 8px; }

/* Toast */
.toast {
  position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 60; background: var(--text); color: var(--bg);
  padding: 10px 16px; border-radius: 12px; font-size: 14.5px; box-shadow: var(--shadow); animation: pop .2s var(--ease);
  max-width: calc(100vw - 32px);
}
.noscript { padding: 24px; text-align: center; }

/* ------------------------------------------------------------ MOBILE */
@media (max-width: 860px) {
  .side { position: fixed; inset: 0 auto 0 0; z-index: 30; transform: translateX(-102%); box-shadow: var(--shadow); width: min(86vw, 320px); will-change: transform; transition: transform .32s cubic-bezier(.32, .72, 0, 1); }
  .app.is-menu .side { transform: none; }
  .scrim { position: fixed; inset: 0; z-index: 25; background: rgba(0, 0, 0, .4); animation: fade .2s; }
  .side .side__close { display: inline-grid; }
  .bar { padding: env(safe-area-inset-top) max(8px, env(safe-area-inset-right)) 0 max(8px, env(safe-area-inset-left)); }
  .bar__title { max-width: 46vw; }
  .starters { grid-template-columns: 1fr; }
  .hello { padding-top: 28px; }
  .hello__cat { width: 116px; height: 116px; }
  .thread { padding: 4px 16px 16px; }
  .dock { padding: 0 10px calc(8px + env(safe-area-inset-bottom)); }
  .msg--ai .msg__avatar { display: none; }
  .plans { grid-template-columns: 1fr; }
  .to-bottom { bottom: 140px; }
}
@media (max-width: 600px) {
  .hello__lead { font-size: 15.5px; margin-bottom: 20px; }
  .caps { flex-wrap: nowrap; justify-content: flex-start; overflow-x: auto; margin: -4px -20px 20px; padding: 0 20px; scrollbar-width: none; }
  .caps::-webkit-scrollbar { display: none; }
  .caps li { flex: none; font-size: 12.5px; }
}
@media (max-width: 420px) {
  .mode span { display: none; }
  .mode { padding: 6px 8px; }
  .quota { display: none; }
}

/* ------------------------------------------------------------ MOTION */
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes pop { from { opacity: 0; transform: scale(.97); } to { opacity: 1; transform: none; } }
.to-bottom, .toast { animation-name: popc; }
@keyframes popc { from { opacity: 0; } to { opacity: 1; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes blink { 0% { opacity: 1; } 100% { opacity: 0; } }
@keyframes hop { 0%, 60%, 100% { transform: translateY(0); } 30% { transform: translateY(-5px); } }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .45; } }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* ------------------------------------------------------------ HALAMAN DOKUMEN */
body.doc-page { overflow: auto; }
.site-nav {
  position: sticky; top: 0; z-index: 10; border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 85%, transparent); backdrop-filter: saturate(1.4) blur(14px);
}
.site-nav__in { max-width: 1120px; margin: 0 auto; height: 64px; padding: 0 20px; display: flex; align-items: center; gap: 24px; }
.site-nav__links { display: flex; gap: 4px; margin-left: auto; }
.site-nav__links a { color: var(--text-2); text-decoration: none; font-size: 14.5px; font-weight: 500; padding: 7px 12px; border-radius: 10px; transition: color .15s, background .15s; }
.site-nav__links a:hover { color: var(--text); background: var(--surface-2); }
.site-nav__links a[aria-current="page"] { color: var(--text); background: var(--surface-2); }
.site-nav__cta { text-decoration: none; padding: 8px 16px; font-size: 14.5px; }

.doc { max-width: 1120px; margin: 0 auto; padding: 56px 20px 80px; }
.doc__hero { max-width: 760px; margin: 0 0 40px; }
.doc--toc .doc__hero { margin-left: 260px; }
.doc__eyebrow {
  display: inline-block; font-size: 12.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  color: var(--accent-text); background: var(--accent-soft); padding: 5px 10px; border-radius: 999px; margin-bottom: 16px;
}
.doc h1 { font-size: clamp(32px, 5vw, 48px); letter-spacing: -.035em; line-height: 1.08; margin: 0 0 14px; font-weight: 800; }
.doc__lead { font-size: 18px; color: var(--text-2); margin: 0 0 18px; max-width: 620px; }
.doc__date { display: inline-flex; font-size: 13px; color: var(--text-3); border: 1px solid var(--line); border-radius: 999px; padding: 4px 12px; }
.doc__grid { display: grid; grid-template-columns: 1fr; gap: 40px; }
.doc--toc .doc__grid { grid-template-columns: 220px minmax(0, 760px); }
.doc__toc { position: sticky; top: 96px; align-self: start; display: flex; flex-direction: column; gap: 2px; font-size: 14px; }
.doc__toc b { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--text-3); margin: 0 0 8px 12px; }
.doc__toc a { color: var(--text-2); text-decoration: none; padding: 6px 12px; border-radius: 8px; border-left: 2px solid transparent; }
.doc__toc a:hover { color: var(--text); background: var(--surface-2); }
.doc__body {
  max-width: 760px; background: var(--surface); border: 1px solid var(--line); border-radius: 24px;
  padding: clamp(24px, 4vw, 44px); box-shadow: var(--shadow); font-size: 16.5px; line-height: 1.75;
}
.doc__body > :first-child { margin-top: 0; }
.doc h2 { font-size: 21px; letter-spacing: -.015em; margin: 36px 0 10px; scroll-margin-top: 90px; }
.doc h3 { font-size: 17px; margin: 24px 0 6px; }
.doc p, .doc li { color: var(--text); }
.doc ul { padding-left: 1.25em; }
.doc li { margin: 6px 0; }
.doc li::marker { color: var(--accent); }
.doc .muted { color: var(--text-3); font-size: 14px; }
.doc .table-wrap { overflow-x: auto; margin: 14px 0 18px; border: 1px solid var(--line); border-radius: 14px; }
.doc table { width: 100%; border-collapse: collapse; font-size: 14.5px; line-height: 1.55; }
.doc th, .doc td { text-align: left; vertical-align: top; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.doc th { font-size: 12.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--text-3); background: var(--bg-side); }
.doc tr:last-child td { border-bottom: 0; }
.doc__body { min-width: 0; }
@media (max-width: 600px) {
  .doc .table-wrap { border: 0; border-radius: 0; overflow: visible; }
  .doc table, .doc tbody, .doc tr, .doc td { display: block; width: 100%; }
  .doc thead { display: none; }
  .doc tr { border: 1px solid var(--line); border-radius: 14px; padding: 6px 0; margin: 0 0 10px; }
  .doc td { border: 0; padding: 4px 14px; }
  .doc td[data-label]::before {
    content: attr(data-label); display: block; font-size: 11.5px; text-transform: uppercase;
    letter-spacing: .06em; color: var(--text-3); margin-bottom: 1px;
  }
  .doc tr:last-child td { border-bottom: 0; }
}
.nf { text-align: center; padding: 8px 0 12px; }
.nf img { width: 160px; height: 160px; display: block; margin: 0 auto 8px; }
.nf .btn { text-decoration: none; }

.site-foot { border-top: 1px solid var(--line); background: var(--bg-side); }
.site-foot__in { max-width: 1120px; margin: 0 auto; padding: 48px 20px 32px; display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 32px; }
.site-foot__brand p { color: var(--text-2); font-size: 14.5px; max-width: 320px; margin: 12px 0 0; }
.site-foot__col { display: flex; flex-direction: column; gap: 8px; font-size: 14.5px; }
.site-foot__col h4 { margin: 4px 0 6px; font-size: 12.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--text-3); }
.site-foot__col a { color: var(--text-2); text-decoration: none; }
.site-foot__col a:hover { color: var(--text); }
.site-foot__bar {
  max-width: 1120px; margin: 0 auto; padding: 18px 20px 28px; border-top: 1px solid var(--line);
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; font-size: 13px; color: var(--text-3);
}
@media (max-width: 900px) {
  .doc--toc .doc__grid { grid-template-columns: 1fr; }
  .doc--toc .doc__hero { margin-left: 0; }
  .doc__toc { display: none; }
  .site-nav__links { display: none; }
  .site-nav__cta { margin-left: auto; }
  .site-foot__in { grid-template-columns: 1fr 1fr; }
  .site-foot__brand { grid-column: 1 / -1; }
  .doc { padding-top: 36px; }
}

/* Sidebar: kredit & tautan legal */
.side__credit { padding: 10px 8px 2px; border-top: 1px solid var(--line); margin-top: 2px; }
.side__credit .legal { padding: 0 0 6px; gap: 0 2px; }
.side__credit .legal a { padding: 3px 5px; border-radius: 6px; font-size: 11.5px; }
.side__credit .legal a:hover { background: var(--surface-2); }
.side__credit small { display: block; padding: 0 6px; font-size: 11.5px; color: var(--text-3); line-height: 1.5; }
.side__credit .ver { display: inline-block; margin-left: 4px; padding: 0 5px; border-radius: 5px; background: var(--surface-2); font: 600 10.5px/1.6 var(--font-mono); color: var(--text-3); }
@media (max-width: 860px) { .side__collapse { display: none !important; } }

/* ------------------------------------------------------------ v2: TOMBOL BAHASA */
.lang { display: inline-flex; padding: 3px; gap: 2px; border-radius: 10px; background: var(--surface-2); }
.lang button {
  border: 0; background: transparent; color: var(--text-3); font: 700 12px/1 var(--font); letter-spacing: .04em;
  padding: 6px 8px; border-radius: 7px; transition: background .15s, color .15s;
}
.lang button:hover { color: var(--text); }
.lang button[aria-pressed="true"] { background: var(--surface); color: var(--text); box-shadow: 0 1px 2px rgba(0, 0, 0, .08); }

/* ------------------------------------------------------------ v2: LAYAR KOSONG ala claude.ai
   Desktop: sapaan + kolom ketik di tengah layar, contoh pertanyaan di bawahnya. */
.main:not(.is-empty) .starters, .main:not(.is-empty) .hello__cta { display: none; }
.bar__title[hidden] { display: none !important; }
@media (min-width: 861px) and (min-height: 560px) {
  .main.is-empty .scroller { flex: 0 1 auto; margin-top: auto; padding-top: 56px; }
  .main.is-empty .thread { display: none; }
  .main.is-empty .dock { margin-bottom: auto; padding-bottom: 32px; }
  .main.is-empty .hello { padding: 0 20px 18px; }
  .main.is-empty .caps { margin-bottom: 4px; }
  .main.is-empty .starter { padding: 12px 14px; align-items: center; }
  .main.is-empty .dock__note { display: none; }
  .main.is-empty .bar { position: absolute; top: 0; left: 0; right: 0; z-index: 3; }
}
@media (min-width: 861px) and (max-height: 760px) {
  .hello__stage, .hello__cat { width: 104px; height: 104px; }
  .hello__title { font-size: 30px; }
  .hello__lead { margin-bottom: 14px; }
  .caps { display: none; }
}
/* Tampilan awal tidak berkedip: teks sambutan muncul setelah app.js mengisinya. */
html.booting .hello > *, html.booting .starters, html.booting .hello__cta, html.booting .me { opacity: 0; }
.hello > *, .starters, .hello__cta, .me { transition: opacity .25s var(--ease); }

/* Tombol Google di sidebar */
#loginSide svg { width: 18px; height: 18px; background: #fff; border-radius: 50%; padding: 2px; box-sizing: content-box; }

/* Sidebar lebih rapi */
.btn--new { font-size: 14.5px; padding: 9px 12px; border-radius: 11px; box-shadow: 0 1px 2px rgba(0, 0, 0, .04); }
.btn--new:hover { border-color: var(--accent); color: var(--accent-text); }
.side__credit small { letter-spacing: .01em; }

/* Pesan */
.msg { padding: 10px 0; }
.msg--user + .msg--ai { padding-top: 14px; }
.msg--ai .msg__body { font-size: 16px; line-height: 1.7; }
.msg__body h3 { letter-spacing: -.01em; }
.msg__body table { border-radius: 10px; }
.msg__body th { background: var(--surface-2); font-weight: 600; }
.gate img { image-rendering: auto; }
.modal__art { width: 84px; height: 84px; }

/* Composer: sedikit lebih lega & berkelas */
.composer { border-radius: 24px; padding: 14px 12px 10px 18px; }
.send { border-radius: 50%; }
.dock { padding-top: 6px; }

/* ------------------------------------------------------------ v2: MOBILE */
@media (max-width: 860px) {
  .starters {
    display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; margin: 0 -10px 8px; padding: 2px 10px;
    scroll-snap-type: x proximity; order: -1;
  }
  .starters::-webkit-scrollbar { display: none; }
  .starter { flex: 0 0 min(74vw, 280px); scroll-snap-align: start; padding: 10px 12px; gap: 10px; }
  .starter .starter__ico { width: 30px; height: 30px; }
  .starter__txt span { font-size: 13px; }
  .dock { display: flex; flex-direction: column; }
  .dock > .edit-bar { order: -2; }
  .hello__cta { margin: 0 0 8px; order: -1; font-size: 12.5px; }
  .hello__stage, .hello__cat { width: 104px; height: 104px; }
  .caps { gap: 6px; }
  .lang button { padding: 6px 7px; }
}
@media (max-width: 600px) {
  .caps { flex-wrap: wrap; justify-content: center; overflow: visible; margin: -4px 0 16px; padding: 0; }
  .caps li { flex: none; font-size: 12px; padding: 4px 10px 4px 8px; }
  .hello__title { font-size: 27px; }
}
@media (max-width: 380px) {
  .caps li:nth-child(3) { display: none; }
}
@keyframes shadow { 0%, 100% { transform: translateX(-50%) scale(1); opacity: 1; } 50% { transform: translateX(-50%) scale(.86); opacity: .7; } }
:root[data-theme="dark"] .hello__stage::after { background: rgba(255, 122, 46, .16); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .hello__stage::after { background: rgba(255, 122, 46, .16); } }
.side__credit .legal { display: grid; grid-template-columns: repeat(3, max-content); justify-content: start; }
@media (max-width: 860px) {
  .dock .composer, .dock .starters, .dock .hello__cta, .dock .dock__note { width: 100%; max-width: var(--col); margin-left: auto; margin-right: auto; }
  .dock .starters { width: calc(100% + 20px); margin-left: -10px; margin-right: -10px; }
  .starter { align-items: center; }
  .starter__txt span { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
}
@media (max-width: 600px) {
  .caps { display: none; }
  .hello { padding-top: 16px; }
  .hello__lead { margin-bottom: 8px; }
}
@media (max-width: 860px) { .dock .starters { scroll-padding-inline: 10px; } }

/* ------------------------------------------------------------ v2: HALAMAN DOKUMEN */
.lang--doc { margin-left: 8px; }
.lang--doc a {
  color: var(--text-3); font: 700 12px/1 var(--font); letter-spacing: .04em; text-decoration: none;
  padding: 6px 8px; border-radius: 7px;
}
.lang--doc a:hover { color: var(--text); }
.lang--doc a[aria-current] { background: var(--surface); color: var(--text); box-shadow: 0 1px 2px rgba(0, 0, 0, .08); }
.site-nav__links + .lang--doc { margin-left: 8px; }
.about-hero { display: flex; gap: 24px; align-items: center; margin-bottom: 8px; }
.about-hero img { width: 150px; height: 150px; flex: none; }
.about-hero p { margin: 0 0 12px; }
.credits { display: grid; grid-template-columns: 140px 1fr; gap: 10px 20px; margin: 8px 0 0; padding: 18px 20px; border: 1px solid var(--line); border-radius: 16px; background: var(--bg-side); }
.credits dt { color: var(--text-3); font-size: 14.5px; }
.credits dd { margin: 0; }
.nf .btn { margin: 4px; }
@media (max-width: 900px) {
  .lang--doc { margin-left: auto; }
  .site-nav__cta { margin-left: 8px; }
}
@media (max-width: 600px) {
  .about-hero { flex-direction: column; text-align: center; }
  .credits { grid-template-columns: 1fr; gap: 2px; }
  .credits dd { margin-bottom: 10px; }
  .site-nav__cta { display: none; }
}
@media (max-width: 900px) { .site-nav__links + .lang--doc { margin-left: auto; } }
@media (max-width: 600px) { .about-hero { text-align: left; } .about-hero img { align-self: center; } }

/* M004 — label mode otomatis di atas jawaban */
.route-chip { display: inline-block; margin: 0 0 6px; padding: 2px 9px; border: 1px solid var(--line); border-radius: 999px; font-size: 12px; line-height: 18px; color: var(--text-3); }

/* M011 — lanjutkan belajar */
.resume { max-width: var(--col); margin: 12px auto 0; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.resume__lbl { font-size: 13px; color: var(--text-3); margin-right: 2px; }
.resume__item { display: inline-flex; align-items: baseline; gap: 6px; max-width: 100%; padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px; background: transparent; color: var(--text); font: inherit; font-size: 13px; cursor: pointer; }
.resume__item span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 220px; }
.resume__item small { color: var(--text-3); font-size: 11px; }
.resume__item:hover { border-color: color-mix(in srgb, var(--accent) 55%, var(--line)); }

/* ------------------------------------------------------------ M017 VISUAL
   Diagram (Mermaid) dan grafik (SVG milik JIJI) di dalam jawaban. Warna seri
   memakai token tema; SVG menyesuaikan lebar kolom, diagram lebar bisa digeser. */
:root {
  --viz-0: #F26B1D; --viz-1: #2563EB; --viz-2: #16A37F; --viz-3: #9333EA; --viz-4: #D97706; --viz-5: #DB2777;
  --viz-grid: #ECECEF; --viz-axis: #A1A1AA;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --viz-0: #FF7A2E; --viz-1: #60A5FA; --viz-2: #34D3A6; --viz-3: #C084FC; --viz-4: #FBBF24; --viz-5: #F472B6; --viz-grid: #1F1F23; --viz-axis: #52525B; }
}
:root[data-theme="dark"] { --viz-0: #FF7A2E; --viz-1: #60A5FA; --viz-2: #34D3A6; --viz-3: #C084FC; --viz-4: #FBBF24; --viz-5: #F472B6; --viz-grid: #1F1F23; --viz-axis: #52525B; }

.viz { margin: 14px 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); padding: 12px 12px 10px; max-width: 100%; }
.viz__label { display: block; font-size: 12px; font-weight: 600; letter-spacing: .02em; text-transform: uppercase; color: var(--text-3); margin-bottom: 6px; }
.viz__wait { color: var(--text-2); font-size: 14px; padding: 18px 0; text-align: center; }
.viz--pending .viz__wait, .viz--wait .viz__wait { animation: vizPulse 1.4s ease-in-out infinite; }
@keyframes vizPulse { 50% { opacity: .45; } }
@media (prefers-reduced-motion: reduce) { .viz--pending .viz__wait, .viz--wait .viz__wait { animation: none; } }
.viz__body { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.viz--mermaid .viz__body svg { display: block; margin: 0 auto; max-width: 100%; height: auto; }
.viz-svg { display: block; width: 100%; height: auto; font-family: var(--font); }
.viz-svg text { fill: var(--text-2); font-size: 12px; }
.viz-svg .viz-title { fill: var(--text); font-size: 14px; font-weight: 600; }
.viz-svg .viz-lab { fill: var(--text); font-size: 11px; font-weight: 600; paint-order: stroke; stroke: var(--surface); stroke-width: 3px; }
.viz-svg .viz-lab--in { fill: #FFFFFF; stroke: none; }
.viz-grid { stroke: var(--viz-grid); stroke-width: 1; }
.viz-axis { stroke: var(--viz-axis); stroke-width: 1.4; }
.viz-line { fill: none; stroke-width: 2.4; stroke-linejoin: round; stroke-linecap: round; }
.viz-pt { stroke: var(--surface); stroke-width: 1.5; }
.viz-slice { stroke: var(--surface); stroke-width: 2; }
.viz-line.viz-c0 { stroke: var(--viz-0); } .viz-line.viz-c1 { stroke: var(--viz-1); } .viz-line.viz-c2 { stroke: var(--viz-2); }
.viz-line.viz-c3 { stroke: var(--viz-3); } .viz-line.viz-c4 { stroke: var(--viz-4); } .viz-line.viz-c5 { stroke: var(--viz-5); }
.viz-bar.viz-c0, .viz-pt.viz-c0, .viz-slice.viz-c0, .viz-swatch.viz-c0 { fill: var(--viz-0); }
.viz-bar.viz-c1, .viz-pt.viz-c1, .viz-slice.viz-c1, .viz-swatch.viz-c1 { fill: var(--viz-1); }
.viz-bar.viz-c2, .viz-pt.viz-c2, .viz-slice.viz-c2, .viz-swatch.viz-c2 { fill: var(--viz-2); }
.viz-bar.viz-c3, .viz-pt.viz-c3, .viz-slice.viz-c3, .viz-swatch.viz-c3 { fill: var(--viz-3); }
.viz-bar.viz-c4, .viz-pt.viz-c4, .viz-slice.viz-c4, .viz-swatch.viz-c4 { fill: var(--viz-4); }
.viz-bar.viz-c5, .viz-pt.viz-c5, .viz-slice.viz-c5, .viz-swatch.viz-c5 { fill: var(--viz-5); }
.viz-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 13px; color: var(--text-2); margin-top: 6px; }
.viz-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.viz-legend i.viz-c0 { background: var(--viz-0); } .viz-legend i.viz-c1 { background: var(--viz-1); } .viz-legend i.viz-c2 { background: var(--viz-2); }
.viz-legend i.viz-c3 { background: var(--viz-3); } .viz-legend i.viz-c4 { background: var(--viz-4); } .viz-legend i.viz-c5 { background: var(--viz-5); }
.viz-data { margin-top: 8px; font-size: 13px; }
.viz-data summary { cursor: pointer; color: var(--text-2); }
.viz-data table { margin-top: 6px; }
.viz-fail { color: var(--text-2); font-size: 14px; margin: 4px 0 8px; }
.viz-code { background: var(--code-bg); color: var(--code-text); border-radius: 10px; padding: 10px 12px; overflow-x: auto; font-size: 13px; margin: 0; }

/* #8 pengingat perpanjangan Plus */
.renew { display: flex; align-items: center; gap: 10px; margin: 0 auto 8px; max-width: var(--col); padding: 8px 10px 8px 14px;
  border: 1px solid var(--accent); background: var(--accent-soft); border-radius: var(--radius); font-size: 14px; color: var(--text); }
.renew span { flex: 1; }
.renew .btn { padding: 6px 12px; font-size: 13px; }
.renew__x { background: none; border: 0; color: var(--text-2); font-size: 20px; line-height: 1; cursor: pointer; padding: 2px 6px; }
@media (max-width: 520px) { .renew { flex-wrap: wrap; } .renew span { flex-basis: 100%; } }

/* M018 — laporan jawaban */
.report-reasons { display: grid; gap: 6px; margin: 4px 0 12px; }
.report-reason { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--line-strong); border-radius: 10px; cursor: pointer; }
.report-reason:has(input:checked) { border-color: var(--accent); }
.report-reason input { accent-color: var(--accent); margin: 0; }
#reportNote { resize: vertical; min-height: 72px; font: inherit; }

/* Aplikasi iOS: rasa native — tanpa sorotan abu-abu saat mengetuk, tanpa menu tahan-lama
   pada tombol/ikon, dan tanpa pantulan (pull-to-refresh tetap dari UIRefreshControl). */
.in-ios-app { -webkit-tap-highlight-color: transparent; }
.in-ios-app button, .in-ios-app .icon-btn, .in-ios-app img, .in-ios-app .brand { -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; }

/* ------------------------------------------------------------ v3: HP lebih padat & jelas
   Hero lebih kecil, 4 contoh pertanyaan tersusun vertikal (langsung terlihat, tanpa geser),
   dan label mode selalu tampil — bukan ikon tanpa nama. */
@media (max-width: 600px) {
  .hello { padding-top: 8px; }
  .hello__stage, .hello__cat { width: 72px; height: 72px; }
  .hello__title { font-size: 24px; margin-bottom: 6px; }
  .hello__lead { font-size: 14.5px; line-height: 1.5; margin-bottom: 4px; }
  .starters { display: grid; grid-template-columns: 1fr; gap: 6px; overflow: visible; scroll-snap-type: none; margin: 0 0 10px; padding: 0; }
  .dock .starters { width: 100%; margin-left: 0; margin-right: 0; }
  .starter { flex: none; padding: 9px 12px; gap: 10px; border-radius: 14px; }
  .starter .starter__ico { width: 28px; height: 28px; border-radius: 8px; }
  .starter__txt b { display: none; }
  .starter__txt span { -webkit-line-clamp: 1; font-size: 14px; color: var(--text); }
}
@media (max-width: 860px) {
  .scroller { overflow-x: hidden; }
  /* Layar kosong: sapaan di tengah ruang antara bar atas dan contoh pertanyaan. */
  .main.is-empty .scroller { display: flex; flex-direction: column; justify-content: center; }
}
@media (max-width: 420px) {
  .mode svg { display: none; }
  .modes { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .modes::-webkit-scrollbar { display: none; }
  .mode { flex: none; padding: 6px 10px; }
  .mode span { display: inline; }
}

/* ------------------------------------------------------------ v3: pilihan peran
   Mahasiswa / UTBK-SNBT (Exam prep) / Dosen & Guru → contoh pertanyaan menyesuaikan. */
.personas { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; max-width: var(--col); margin: 12px auto 4px; }
.persona {
  border: 1px solid var(--line-strong); background: transparent; color: var(--text-2);
  border-radius: 999px; padding: 6px 14px; font-weight: 600; font-size: 13.5px;
  transition: background .15s, color .15s, border-color .15s;
}
.persona:hover { color: var(--text); border-color: var(--text-3); }
.persona[aria-checked="true"] { background: var(--text); color: var(--bg); border-color: var(--text); }
.main:not(.is-empty) .personas { display: none; }
html.booting .personas { opacity: 0; }
.personas { transition: opacity .25s var(--ease); }
@media (max-width: 860px) {
  .dock .personas { order: -1; margin: 0 auto 8px; width: 100%; }
}
