  :root {
    --bg: #071026;
    --panel: #0D1B3E;
    --panel-2: #13265A;
    --line: #243A73;
    --ink: #EAF1FF;
    --muted: #9DB0D9;
    --accent: #4D9BFF;
    --accent-ink: #04112B;
    --ok: #5CE0B0;
    --danger-bg: #4A1D33;
    --danger-ink: #FFC2D1;
    --code-bg: #040A1B;
    --display: "Bricolage Grotesque", "Trebuchet MS", system-ui, sans-serif;
    --body: "Figtree", system-ui, -apple-system, "Segoe UI", sans-serif;
    box-sizing: border-box;
    padding-top: env(safe-area-inset-top, 0px);
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }
  :root[data-theme="light"] {
    --bg: #E6EEFC;
    --panel: #FFFFFF;
    --panel-2: #DCE7FB;
    --line: #B5C7EE;
    --ink: #0A1A45;
    --muted: #46598B;
    --accent: #12338F;
    --accent-ink: #FFFFFF;
    --ok: #0E9F6E;
    --danger-bg: #FFE1E8;
    --danger-ink: #7A1030;
    --code-bg: #0A1A45;
  }
  *, *::before, *::after { box-sizing: border-box; }
  html { height: 100%; background: var(--bg); }
  body {
    margin: 0; height: 100%; overflow: hidden; background: var(--bg); color: var(--ink);
    font-family: var(--body); font-size: 16px; line-height: 1.5; -webkit-font-smoothing: antialiased;
  }
  button, input, select, textarea { font: inherit; color: inherit; }
  a { color: inherit; }
  :focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 8px; }

  /* Kerangka satu layar */
  .app {
    height: calc(var(--appH, 100dvh) - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px));
    display: flex; flex-direction: column; max-width: 1280px; margin: 0 auto;
  }
  .brand { order: 1; display: flex; align-items: center; justify-content: space-between; padding: 10px 16px; background: var(--panel); border-bottom: 1px solid var(--line); }
  .views { order: 2; flex: 1; min-height: 0; padding: 12px; position: relative; }
  .tabs { order: 3; display: flex; background: var(--panel); border-top: 1px solid var(--line); padding: 6px 8px; gap: 4px; }
  .foot { display: none; }

  .logo { display: flex; align-items: center; gap: 10px; font-family: var(--display); font-weight: 800; font-size: 20px; letter-spacing: -0.02em; }
  .logo i { width: 30px; height: 30px; border-radius: 10px; background: var(--accent); display: grid; place-items: center; }
  .logo i::after { content: ""; width: 12px; height: 12px; border-radius: 50%; border: 3px solid var(--accent-ink); }
  .icon-btn { width: 38px; height: 38px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel-2); cursor: pointer; display: grid; place-items: center; }
  .icon-btn svg { width: 18px; height: 18px; }

  .tab {
    flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; border: 0; background: transparent;
    color: var(--muted); font-size: 12px; font-weight: 600; padding: 7px 4px; border-radius: 12px; cursor: pointer;
  }
  .tab svg { width: 22px; height: 22px; }
  .tab[aria-selected="true"] { color: var(--ink); background: var(--panel-2); }
  .tab[aria-selected="true"] svg { color: var(--accent); }

  @media (min-width: 880px) {
    .app { display: grid; grid-template-columns: 250px 1fr; grid-template-rows: auto auto 1fr; grid-template-areas: "brand views" "tabs views" "foot views"; }
    .brand { grid-area: brand; order: 0; border-bottom: 0; border-right: 1px solid var(--line); padding: 20px 18px 12px; }
    .tabs { grid-area: tabs; order: 0; flex-direction: column; border-top: 0; border-right: 1px solid var(--line); padding: 4px 12px; }
    .foot { grid-area: foot; display: block; background: var(--panel); border-right: 1px solid var(--line); padding: 16px 18px; color: var(--muted); font-size: 13px; align-self: stretch; }
    .foot b { color: var(--ink); display: block; margin-bottom: 2px; }
    .views { grid-area: views; order: 0; padding: 22px; }
    .tab { flex: none; flex-direction: row; gap: 12px; font-size: 15px; padding: 12px 14px; justify-content: flex-start; }
    .tab[aria-selected="true"] { box-shadow: inset 3px 0 0 var(--accent); }
  }

  /* Tampilan */
  .view { display: none; height: 100%; min-height: 0; flex-direction: column; gap: 14px; overflow: auto; animation: swap .22s ease; }
  .view.active { display: flex; }
  @keyframes swap { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
  .vhead h2 { font-family: var(--display); font-weight: 800; font-size: clamp(22px, 3vw, 30px); letter-spacing: -0.03em; line-height: 1.1; margin: 0 0 4px; }
  .vhead p { margin: 0; color: var(--muted); font-size: 15px; }

  /* Chat */
  .chatbox { flex: 1; min-height: 0; display: flex; flex-direction: column; background: var(--panel); border: 1px solid var(--line); border-radius: 22px; overflow: hidden; }
  .chat-head { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
  .chat-head .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--ok); }
  .chat-head strong { font-family: var(--display); font-size: 17px; }
  .chat-head button { margin-left: auto; background: transparent; border: 1px solid var(--line); color: var(--muted); border-radius: 999px; padding: 4px 12px; font-size: 13px; font-weight: 600; cursor: pointer; }
  .chat-head button:hover { color: var(--ink); background: var(--panel-2); }
  .modes { display: flex; gap: 8px; padding: 10px 16px; overflow-x: auto; scrollbar-width: none; border-bottom: 1px solid var(--line); }
  .modes::-webkit-scrollbar { display: none; }
  .mode { flex: none; border: 1px solid var(--line); background: transparent; color: var(--muted); border-radius: 999px; padding: 5px 14px; font-size: 14px; font-weight: 600; cursor: pointer; }
  .engine { flex: none; border: 1px solid var(--line); background: transparent; color: var(--muted); border-radius: 8px; padding: 5px 14px; font-size: 14px; font-weight: 600; cursor: pointer; }
  .engine[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
  .mode[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
  .log { flex: 1; min-height: 0; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 12px; }
  .empty { margin: auto; text-align: center; max-width: 520px; padding: 8px; }
  .empty.hidden { display: none; }
  .empty h1 { font-family: var(--display); font-weight: 800; font-size: clamp(26px, 4vw, 40px); letter-spacing: -0.035em; line-height: 1.05; margin: 0 0 8px; }
  .empty p { margin: 0 0 18px; color: var(--muted); }
  .sugs { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
  .sug { background: var(--panel-2); border: 1px solid var(--line); border-radius: 14px; padding: 9px 14px; font-size: 14px; font-weight: 500; cursor: pointer; text-align: left; }
  .sug:hover { border-color: var(--accent); }
  .msg { max-width: 86%; padding: 10px 14px; border-radius: 18px; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.55; }
  .msg.ai { background: var(--panel-2); border-bottom-left-radius: 6px; align-self: flex-start; }
  .msg.me { background: var(--accent); color: var(--accent-ink); border-bottom-right-radius: 6px; align-self: flex-end; font-weight: 500; }
  .msg.err { background: var(--danger-bg); color: var(--danger-ink); align-self: flex-start; }
  .msg pre { margin: 8px 0; padding: 10px 12px; background: var(--code-bg); color: #EAF1FF; border-radius: 10px; overflow-x: auto; font-size: 13.5px; white-space: pre; }
  .msg code { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .92em; }
  .msg :not(pre) > code { background: color-mix(in srgb, var(--ink) 14%, transparent); padding: 1px 5px; border-radius: 5px; }
  .copy { display: block; margin-top: 8px; background: transparent; border: 1px solid var(--line); color: var(--muted); border-radius: 999px; padding: 2px 10px; font-size: 12px; font-weight: 600; cursor: pointer; }
  .copy:hover { color: var(--ink); }
  .typing { display: inline-flex; gap: 5px; padding: 6px 0; }
  .typing span { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); animation: blink 1s infinite ease-in-out; }
  .typing span:nth-child(2) { animation-delay: .15s; } .typing span:nth-child(3) { animation-delay: .3s; }
  @keyframes blink { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }
  .offline { display: none; margin: 0 16px 8px; padding: 10px 14px; border-radius: 12px; background: var(--danger-bg); color: var(--danger-ink); font-size: 14px; }
  .offline button { background: none; border: 0; text-decoration: underline; cursor: pointer; padding: 0; color: inherit; font-weight: 700; }
  .composer { display: flex; gap: 10px; align-items: flex-end; padding: 12px 14px; border-top: 1px solid var(--line); }
  .composer textarea { flex: 1; resize: none; min-height: 46px; max-height: 120px; background: var(--bg); border: 1px solid var(--line); border-radius: 16px; padding: 11px 14px; line-height: 1.4; }
  .btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; background: var(--accent); color: var(--accent-ink); border: 0; border-radius: 14px; padding: 12px 20px; font-weight: 700; cursor: pointer; text-decoration: none; }
  .btn:hover { filter: brightness(1.08); }
  .btn[disabled] { opacity: .5; cursor: not-allowed; }
  .btn.ghost { background: var(--panel-2); color: var(--ink); border: 1px solid var(--line); }
  .note { margin: 0; padding: 0 16px 10px; font-size: 12px; color: var(--muted); }

  /* Layanan */
  .svcs { flex: 1; min-height: 0; display: grid; gap: 12px; grid-template-columns: repeat(2, 1fr); grid-auto-rows: minmax(0, 1fr); }
  .svc { text-align: left; display: flex; flex-direction: column; justify-content: space-between; gap: 6px; background: var(--panel); border: 1px solid var(--line); border-radius: 20px; padding: 16px; cursor: pointer; min-height: 0; transition: border-color .15s, transform .15s; }
  .svc:hover { border-color: var(--accent); transform: translateY(-2px); }
  .svc .ico { width: 42px; height: 42px; border-radius: 14px; background: var(--panel-2); display: grid; place-items: center; font-size: 22px; }
  .svc h3 { margin: 0; font-family: var(--display); font-size: 17px; letter-spacing: -0.02em; line-height: 1.15; }
  .svc p { display: none; margin: 0; color: var(--muted); font-size: 14px; }
  .svc .go { color: var(--accent); font-weight: 700; font-size: 13px; display: none; }
  :root[data-theme="light"] .svc .go { color: var(--ink); }
  @media (min-width: 880px) {
    .svcs { grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(2, minmax(0, 1fr)); gap: 16px; }
    .svc { padding: 22px; }
    .svc p, .svc .go { display: block; }
    .svc h3 { font-size: 20px; }
  }

  /* Bantuan */
  .faq { flex: 1; min-height: 0; display: grid; gap: 12px; grid-template-columns: 1fr; grid-template-rows: auto minmax(0, 1fr); }
  .qlist { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
  .qlist::-webkit-scrollbar { display: none; }
  .q { flex: none; text-align: left; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 10px 14px; font-size: 14px; font-weight: 600; cursor: pointer; color: var(--muted); max-width: 240px; }
  .q[aria-selected="true"] { color: var(--ink); border-color: var(--accent); background: var(--panel-2); }
  .answer { background: var(--panel); border: 1px solid var(--line); border-radius: 22px; padding: 22px; overflow: auto; display: flex; flex-direction: column; gap: 14px; }
  .answer h3 { margin: 0; font-family: var(--display); font-size: clamp(20px, 2.6vw, 26px); letter-spacing: -0.02em; line-height: 1.15; }
  .answer p { margin: 0; color: var(--muted); font-size: 16px; max-width: 62ch; }
  .answer .btn { align-self: flex-start; margin-top: auto; }
  @media (min-width: 880px) {
    .faq { grid-template-columns: 300px 1fr; grid-template-rows: minmax(0, 1fr); gap: 18px; }
    .qlist { flex-direction: column; overflow-x: visible; overflow-y: auto; }
    .q { max-width: none; padding: 14px 16px; font-size: 15px; }
    .answer { padding: 30px; }
  }

  /* Kontak */
  .contact { flex: 1; min-height: 0; display: grid; gap: 12px; grid-template-columns: 1fr; align-content: start; }
  .cinfo { display: grid; gap: 10px; align-content: start; }
  .row { display: flex; align-items: center; gap: 14px; background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 14px 16px; text-decoration: none; }
  a.row:hover { border-color: var(--accent); }
  .row .ico { flex: none; width: 40px; height: 40px; border-radius: 13px; background: var(--panel-2); display: grid; place-items: center; font-size: 19px; }
  .row small { display: block; color: var(--muted); font-size: 12px; font-weight: 600; }
  .row b { font-weight: 600; overflow-wrap: anywhere; }
  .form { background: var(--panel); border: 1px solid var(--line); border-radius: 22px; padding: 18px; display: grid; gap: 10px; align-content: start; }
  .form h3 { margin: 0; font-family: var(--display); font-size: 19px; letter-spacing: -0.02em; }
  .form label { font-size: 13px; font-weight: 600; color: var(--muted); display: grid; gap: 4px; }
  .form input, .form select, .form textarea { background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; width: 100%; }
  .form textarea { min-height: 74px; resize: none; }
  .two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
  @media (min-width: 880px) {
    .contact { grid-template-columns: 5fr 6fr; gap: 18px; }
    .form { padding: 24px; }
  }

  @media (prefers-reduced-motion: reduce) {
    .view { animation: none; }
    .svc, .svc:hover { transition: none; transform: none; }
    .typing span { animation: none; opacity: .6; }
  }

  /* ===== Penyempurnaan tampilan: layar penuh, tahan zoom ===== */
  :root { padding: 0; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
  html, body { width: 100%; overflow: hidden; overscroll-behavior: none; }
  body { background: radial-gradient(900px 500px at 85% -10%, color-mix(in srgb, var(--accent) 22%, transparent), transparent 70%), var(--bg); }
  .app {
    position: fixed; inset: 0; height: auto; width: 100%; max-width: none; margin: 0;
    padding: env(safe-area-inset-top, 0px) env(safe-area-inset-right, 0px) env(safe-area-inset-bottom, 0px) env(safe-area-inset-left, 0px);
  }
  .views, .view, .chatbox, .log, .modes, .composer { min-width: 0; }
  .brand { background: color-mix(in srgb, var(--panel) 80%, transparent); backdrop-filter: blur(10px); }
  .modes { scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  #engines { padding-bottom: 4px; border-bottom: 0; }
  .engine { border-radius: 999px; }
  .engine::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: currentColor; opacity: .55; margin-right: 7px; vertical-align: 1px; }
  .engine[aria-pressed="true"]::before { opacity: 1; }
  .msg { font-size: 15.5px; box-shadow: 0 1px 0 rgba(0,0,0,.12); }
  .msg.me { background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 65%, #7C5CFF)); }
  .msg.typing-out::after { content: ""; display: inline-block; width: 7px; height: 1.05em; margin-left: 2px; background: var(--accent); vertical-align: text-bottom; border-radius: 2px; animation: caret 1s steps(2, start) infinite; }
  @keyframes caret { to { visibility: hidden; } }
  .composer { background: color-mix(in srgb, var(--panel) 92%, transparent); }
  .composer textarea { border-radius: 22px; }
  #sendBtn { border-radius: 999px; height: 46px; padding: 0 20px; }

  @media (max-width: 879px) {
    .views { padding: 0; }
    .view:not(#v-chat) { padding: 14px; }
    .chatbox { border: 0; border-radius: 0; background: transparent; }
    .chat-head { padding: 10px 14px; }
    .modes { padding: 8px 14px; }
    .log { padding: 12px 14px; }
    .msg { max-width: 92%; }
    .composer { padding: 10px 12px; }
    .note { padding: 0 14px 8px; }
    .tabs { padding: 6px 8px; }
  }

  .fstatus { margin: 0; min-height: 1.3em; font-size: 14px; color: var(--muted); }
  .fstatus.ok { color: var(--ok); font-weight: 600; }
  .fstatus.bad { color: var(--danger-ink); }
  :root[data-theme="light"] .fstatus.bad { color: #A01435; }
  .form { position: relative; }

  /* ===== Percantik: aurora, kaca, animasi ===== */
  body::before, body::after { content: ""; position: fixed; z-index: -1; width: 60vmax; height: 60vmax; border-radius: 50%; filter: blur(80px); opacity: .28; pointer-events: none; animation: drift 22s ease-in-out infinite alternate; }
  body::before { background: #4D9BFF; top: -25vmax; left: -15vmax; }
  body::after { background: #8B5CF6; bottom: -28vmax; right: -18vmax; animation-delay: -11s; }
  :root[data-theme="light"] body::before, :root[data-theme="light"] body::after { opacity: .18; }
  @keyframes drift { to { transform: translate(8vmax, 6vmax) scale(1.15); } }
  .logo { background: linear-gradient(90deg, var(--ink), var(--accent)); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
  .logo i { box-shadow: 0 0 18px color-mix(in srgb, var(--accent) 70%, transparent); animation: glow 3s ease-in-out infinite; }
  @keyframes glow { 50% { box-shadow: 0 0 6px color-mix(in srgb, var(--accent) 40%, transparent); } }
  .greet { font-weight: 600; color: var(--accent); margin-bottom: 6px; letter-spacing: .02em; }
  .empty h1 { background: linear-gradient(90deg, var(--ink) 30%, var(--accent)); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
  .sug { backdrop-filter: blur(6px); transition: transform .15s, border-color .15s, box-shadow .15s; }
  .sug:hover, .sug:active { transform: translateY(-2px); box-shadow: 0 6px 18px color-mix(in srgb, var(--accent) 25%, transparent); }
  .msg { animation: pop .28s cubic-bezier(.2,.9,.3,1.2); }
  @keyframes pop { from { opacity: 0; transform: translateY(10px) scale(.97); } to { opacity: 1; transform: none; } }
  .msg.ai { border: 1px solid var(--line); backdrop-filter: blur(6px); }
  .acts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
  .acts .copy { margin-top: 0; display: inline-block; }
  .mic { flex: none; width: 46px; height: 46px; border-radius: 50%; border: 1px solid var(--line); background: var(--panel-2); font-size: 19px; cursor: pointer; display: grid; place-items: center; }
  .mic.on { background: #E5484D; border-color: #E5484D; animation: pulse 1.1s infinite; }
  @keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(229,72,77,.6); } 100% { box-shadow: 0 0 0 14px rgba(229,72,77,0); } }
  .btn { transition: transform .12s, filter .15s; } .btn:active { transform: scale(.96); }
  #sendBtn { background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 60%, #8B5CF6)); }
  .tab[aria-selected="true"] { box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 45%, transparent), 0 6px 18px color-mix(in srgb, var(--accent) 22%, transparent); }
  .svc, .row, .form { backdrop-filter: blur(8px); }
  @media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
  body { background: transparent; }

  .logo { background: none; -webkit-text-fill-color: currentColor; color: var(--ink); }

  .toolnote { margin-top: 8px; font-size: 12px; color: var(--muted); }
