:root {
  --page: #f4f6f9;
  --surface: #ffffff;
  --ink: #1c2230;
  --ink-soft: #5d6575;
  --ink-faint: #9aa1ae;
  --line: #e9ecf1;
  --fill: #f1f3f7;
  --navy: #1c2230;
  --gold: #b48a52;
  --gold-soft: #f7efe3;
  --ok: #3f8a5f;
  --warn: #b5763a;
  --crit: #b4433b;
  --shadow: 0 1px 2px rgba(28, 34, 48, .04), 0 12px 32px -12px rgba(60, 80, 120, .18);
  --sans: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; margin: 0; }
body { background: var(--page); color: var(--ink); font: 15px/1.55 var(--sans); -webkit-font-smoothing: antialiased; }
button, textarea { font: inherit; color: inherit; }

/* Kerangka: HP = Ola di atas + kartu chat di bawah; desktop = Ola di kiri + kartu chat di kanan */
.layout { display: flex; flex-direction: column; height: 100dvh; max-width: 480px; margin: 0 auto; }
.app { position: relative; flex: 1; min-height: 0; width: 100%; overflow: hidden; background: var(--surface); isolation: isolate;
  border-radius: 24px 24px 0 0; box-shadow: 0 -14px 34px -22px rgba(60, 80, 120, .35), 0 0 0 1px rgba(28, 34, 48, .04); }

/* Layar loading */
.splash { position: fixed; inset: 0; z-index: 50; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  background: var(--page) radial-gradient(420px 360px at 50% 42%, rgba(255, 196, 150, .35), transparent 70%);
  transition: opacity .5s ease, visibility .5s ease; }
.splash.hide { opacity: 0; visibility: hidden; }
.splash-figure { position: relative; width: 180px; height: 225px; display: grid; place-items: end center; }
.splash-figure img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; opacity: 0; transition: opacity .4s ease;
  -webkit-mask-image: linear-gradient(to bottom, #000 80%, transparent); mask-image: linear-gradient(to bottom, #000 80%, transparent); }
.splash-figure img.ready { opacity: 1; }
.splash-orb { width: 96px; height: 96px; margin-bottom: 60px; border-radius: 50%; animation: breathe 1.4s ease-in-out infinite;
  background: radial-gradient(circle at 36% 40%, #ff5a6e 0, transparent 34%), radial-gradient(circle at 62% 34%, #ffd27a 0, transparent 32%), radial-gradient(circle, #ff9a62 0, #ff8a5c 50%, rgba(255, 160, 130, .3) 70%, transparent 72%); }
.splash-figure img.ready + .splash-orb { display: none; }
.splash-text { font-size: 14px; color: var(--ink-soft); font-weight: 500; }
.dots i { font-style: normal; animation: blink 1.2s infinite ease-in-out; }
.dots i:nth-child(2) { animation-delay: .15s; }
.dots i:nth-child(3) { animation-delay: .3s; }
@media (min-width: 900px) { .splash-figure { width: 210px; height: 262px; } }
@media (prefers-reduced-motion: reduce) { .splash-orb, .dots i { animation: none; } }

/* Panel Ola */
.stage { position: relative; flex: none; display: flex; align-items: flex-end; gap: 14px; padding: 6px 20px 0; z-index: 1; }
.stage::before { content: ''; position: absolute; left: 8px; bottom: -10px; width: 160px; height: 150px; z-index: -1; pointer-events: none;
  background: radial-gradient(closest-side, rgba(255, 190, 150, .45), transparent); }
.figure { width: 112px; height: 140px; flex: none; display: flex; align-items: flex-end; transition: width .35s ease, height .35s ease; }
.figure img { display: block; width: 100%; height: 100%; object-fit: contain;
  -webkit-mask-image: linear-gradient(to bottom, #000 80%, transparent); mask-image: linear-gradient(to bottom, #000 80%, transparent); }
.figure .orb { width: 100%; height: auto; aspect-ratio: 1; }
.stage-text { padding-bottom: 18px; min-width: 0; }
.stage-name { font-size: 26px; font-weight: 700; letter-spacing: -.6px; line-height: 1.1;
  background: linear-gradient(100deg, #e0965a, #d8667a 55%, #8d9fe0); -webkit-background-clip: text; background-clip: text; color: transparent; }
.stage-sub { font-size: 12.5px; color: var(--ink-faint); margin-top: 2px; }
.stage-status { display: inline-flex; align-items: center; gap: 6px; margin-top: 8px; font-size: 12px; color: var(--ink-soft);
  background: rgba(255, 255, 255, .7); border: 1px solid var(--line); border-radius: 999px; padding: 3px 10px; }
.live { width: 7px; height: 7px; border-radius: 50%; background: #3fb07a; box-shadow: 0 0 0 3px rgba(63, 176, 122, .16); }
body.chatting .figure { width: 72px; height: 90px; }
body.chatting .stage-text { padding-bottom: 12px; }
body.chatting .stage-sub { display: none; }

@media (min-width: 900px) {
  .layout { flex-direction: row; align-items: center; justify-content: center; gap: 56px; max-width: none; padding: 24px; }
  .stage { flex-direction: column; align-items: center; text-align: center; width: 250px; padding: 0; gap: 6px; }
  .stage::before { left: 50%; top: 36px; bottom: auto; transform: translateX(-50%); width: 264px; height: 264px; }
  .figure, body.chatting .figure { width: 210px; height: 262px; }
  .figure img { -webkit-mask-image: linear-gradient(to bottom, #000 92%, transparent); mask-image: linear-gradient(to bottom, #000 92%, transparent); }
  .stage-text { padding: 0; }
  .stage-name { font-size: 34px; }
  body.chatting .stage-sub { display: block; }
  .app { flex: none; width: 480px; height: min(860px, calc(100dvh - 48px)); border-radius: 32px;
    box-shadow: 0 30px 80px -30px rgba(60, 80, 120, .28), 0 0 0 1px rgba(28, 34, 48, .04); }
}

/* Cahaya lembut di latar, statis (tanpa animasi) agar ringan */
.glow { position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(420px 320px at 85% -5%, rgba(255, 196, 150, .30), transparent 70%),
    radial-gradient(380px 300px at -10% 40%, rgba(255, 170, 190, .16), transparent 70%),
    radial-gradient(420px 300px at 110% 90%, rgba(150, 190, 255, .16), transparent 70%); }

/* Frosted glass: hanya di header dan dock */
.glass { background: rgba(255, 255, 255, .72); -webkit-backdrop-filter: blur(16px) saturate(160%); backdrop-filter: blur(16px) saturate(160%); }
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) { .glass { background: rgba(255, 255, 255, .95); } }

/* Orb Ola: gradien murni, hanya transform yang dianimasikan */
.orb { position: relative; width: 100%; height: 100%; border-radius: 50%; overflow: hidden;
  background: radial-gradient(circle at 50% 50%, #ffb27a 0%, #ff8a5c 38%, rgba(255, 140, 120, .55) 58%, rgba(255, 200, 190, .12) 72%, transparent 74%); }
.orb i { position: absolute; inset: 0; border-radius: 50%; will-change: transform; animation: spin 14s linear infinite; }
.orb i:nth-child(1) { background: radial-gradient(circle at 34% 40%, rgba(255, 70, 90, .75), transparent 32%); }
.orb i:nth-child(2) { background: radial-gradient(circle at 62% 34%, rgba(255, 214, 120, .95), transparent 30%); animation-duration: 9s; animation-direction: reverse; }
.orb i:nth-child(3) { background: radial-gradient(circle at 55% 66%, rgba(255, 255, 255, .55), transparent 26%); animation-duration: 18s; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes breathe { 50% { transform: scale(1.06); } }
body.chatting .thinking .mini-orb:not(.has-ola), .thinking .mini-orb:not(.has-ola) { animation: breathe 1.4s ease-in-out infinite; }
body.thinking .stage:not(.has-ola) .figure { animation: breathe 1.4s ease-in-out infinite; }
.thinking .orb i { animation-duration: 3s; }
@media (prefers-reduced-motion: reduce) { .orb i, .figure, .thinking .mini-orb { animation: none !important; } }

/* Header */
.top { position: absolute; top: 0; right: 0; z-index: 3; display: flex; align-items: center; padding: 10px; background: none !important; -webkit-backdrop-filter: none; backdrop-filter: none; }
.top .mini-orb, .top .who { display: none; }
.top .icon-btn { background: rgba(255, 255, 255, .8); box-shadow: 0 1px 2px rgba(28, 34, 48, .06), 0 0 0 1px var(--line); }
.mini-orb { width: 30px; height: 30px; flex: none; border-radius: 50%;
  background: radial-gradient(circle at 36% 40%, #ff5a6e 0, transparent 34%), radial-gradient(circle at 62% 34%, #ffd27a 0, transparent 32%), radial-gradient(circle, #ff9a62 0, #ff8a5c 50%, rgba(255, 160, 130, .3) 70%, transparent 72%); }
.who { flex: 1; min-width: 0; }
.name { font-weight: 700; font-size: 16px; letter-spacing: -.2px; line-height: 1.2; }
.status { font-size: 12px; color: var(--ink-faint); line-height: 1.3; }
.icon-btn { width: 36px; height: 36px; border-radius: 50%; border: 0; background: transparent; color: var(--ink-soft); cursor: pointer; display: grid; place-items: center; }
.icon-btn:hover { background: var(--fill); }

/* Percakapan */
.thread { position: absolute; inset: 0; overflow-y: auto; padding: 40px 18px 220px; display: flex; flex-direction: column; scroll-behavior: smooth; overscroll-behavior: contain; }
.mini-orb img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; display: block; }
.mini-orb.has-ola { background: #f3ede4; }

.messages { display: flex; flex-direction: column; gap: 16px; padding-top: 18px; }
.row { display: flex; flex-direction: column; max-width: 92%; }
.row.ola { align-self: flex-start; }
.row.me { align-self: flex-end; align-items: flex-end; max-width: 82%; }
.row.ola.first { align-self: center; align-items: center; text-align: center; max-width: 100%; }
.text { overflow-wrap: anywhere; }
.ola .text { color: var(--ink); }
.ola .text strong { font-weight: 600; }
.me .text { background: var(--fill); padding: 10px 15px; border-radius: 20px 20px 6px 20px; white-space: pre-wrap; }
.text p { margin: 0 0 8px; }
.text p:last-child { margin-bottom: 0; }
.text ul { margin: 4px 0 8px; padding-left: 18px; text-align: left; }
.text li { margin: 3px 0; }
.text em { color: var(--ink-faint); font-style: normal; font-size: 13.5px; }
.text a { color: var(--gold); }
.note { align-self: center; font-size: 12.5px; color: var(--crit); background: #fbeceb; padding: 6px 12px; border-radius: 999px; }
.typing { display: inline-flex; gap: 5px; padding: 6px 2px; }
.typing span { width: 6px; height: 6px; border-radius: 50%; background: var(--ink-faint); animation: blink 1.2s 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; } }

/* Kartu di bawah pesan Ola */
.card { margin-top: 10px; width: min(360px, 84vw); background: var(--surface); border: 1px solid var(--line); border-radius: 18px; overflow: hidden; box-shadow: var(--shadow); text-align: left; }
.card-pad { padding: 14px 16px; }
.eyebrow { font-size: 10.5px; font-weight: 700; letter-spacing: .8px; text-transform: uppercase; color: var(--gold); }
.card-title { font-weight: 700; font-size: 16px; letter-spacing: -.2px; margin: 3px 0 2px; line-height: 1.3; }
.meta { font-size: 12.5px; color: var(--ink-soft); }
.menu-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; padding: 14px 16px 10px; border-bottom: 1px solid var(--line); }
.badge { font-size: 10.5px; font-weight: 600; color: var(--warn); background: #fdf3e8; border-radius: 999px; padding: 3px 9px; white-space: nowrap; }
.cat { padding: 10px 16px 2px; font-size: 10.5px; font-weight: 700; letter-spacing: .7px; text-transform: uppercase; color: var(--ink-faint); }
.item { display: flex; gap: 12px; justify-content: space-between; padding: 8px 16px; }
.item + .item { border-top: 1px solid #f3f4f7; }
.item-name { font-weight: 600; font-size: 14px; line-height: 1.35; }
.item-desc { font-size: 12.5px; color: var(--ink-soft); line-height: 1.4; margin-top: 1px; }
.item-price { text-align: right; white-space: nowrap; font-weight: 600; font-size: 13.5px; }
.item-dur { display: block; font-weight: 400; font-size: 12px; color: var(--ink-faint); }
.more { width: 100%; border: 0; border-top: 1px solid var(--line); background: #fafbfc; padding: 11px; font-size: 13px; font-weight: 600; color: var(--ink); cursor: pointer; }
.choice { width: 100%; text-align: left; border: 0; background: var(--surface); padding: 12px 16px; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.choice + .choice { border-top: 1px solid var(--line); }
.choice:hover { background: #fafbfc; }
.choice b { display: block; font-weight: 600; font-size: 14px; }
.choice small { color: var(--ink-soft); font-size: 12px; }
.chev { color: var(--ink-faint); flex: none; }
.cta { display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 12px; padding: 13px 16px; border-radius: 14px; background: var(--navy); color: #fff; text-decoration: none; font-weight: 600; font-size: 14px; }
.cta:hover { background: #2b3346; }
.ticket-no { font: 600 15px/1.3 ui-monospace, 'SFMono-Regular', Consolas, monospace; letter-spacing: .5px; margin: 4px 0 6px; }
.sev { display: inline-block; font-size: 10.5px; font-weight: 700; border-radius: 999px; padding: 3px 9px; text-transform: uppercase; letter-spacing: .5px; }
.sev.normal { background: #e9f4ee; color: var(--ok); }
.sev.serius { background: #fdf3e8; color: var(--warn); }
.sev.kritis { background: #fbeceb; color: var(--crit); }

/* Dock bawah: pill outlet, quick reply, composer */
.dock { position: absolute; left: 0; right: 0; bottom: 0; z-index: 3; padding: 0 14px; padding-bottom: max(8px, env(safe-area-inset-bottom));
  background: linear-gradient(to top, rgba(255, 255, 255, .96) 55%, rgba(255, 255, 255, 0)); }
.outlet-pill { display: flex; align-items: center; gap: 6px; width: fit-content; max-width: 100%; margin: 0 auto 8px; padding: 6px 12px; border-radius: 999px; font-size: 12.5px; color: var(--ink-soft); border: 1px solid var(--line); white-space: nowrap; overflow: hidden; }
.outlet-pill svg { color: var(--gold); flex: none; }
.ob-brand { font-weight: 700; color: var(--gold); font-size: 11px; letter-spacing: .4px; text-transform: uppercase; }
.ob-name { overflow: hidden; text-overflow: ellipsis; color: var(--ink); font-weight: 500; }
.quick { display: flex; flex-wrap: wrap; gap: 8px; padding: 2px 2px 10px; }
.chip { flex: none; border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 8px 14px; font-size: 13.5px; font-weight: 500; cursor: pointer; box-shadow: 0 1px 2px rgba(28, 34, 48, .04); }
.chip:hover { background: var(--fill); }
.chip.loc { color: var(--gold); border-color: #ecdcc4; background: var(--gold-soft); }

.composer { border-radius: 24px; padding: 12px 12px 10px 16px; border: 1px solid rgba(233, 236, 241, .9); box-shadow: 0 10px 34px -10px rgba(70, 110, 170, .22), 0 1px 2px rgba(28, 34, 48, .04); }
.composer textarea { display: block; width: 100%; resize: none; border: 0; outline: none; background: transparent; padding: 4px 0 8px; max-height: 120px; line-height: 1.45; }
.composer textarea::placeholder { color: var(--ink-faint); }
.tools { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.tool { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 12px 0 10px; border: 0; border-radius: 999px; background: var(--fill); color: var(--ink-soft); font-size: 13px; font-weight: 500; cursor: pointer; }
.tool:hover { background: #e8ebf1; color: var(--ink); }
.tool.busy { opacity: .55; cursor: progress; }
.send { width: 40px; height: 40px; flex: none; border-radius: 50%; border: 0; background: var(--navy); color: #fff; cursor: pointer; display: grid; place-items: center; transition: transform .15s ease, background .15s ease; }
.send:hover { transform: translateY(-1px); }
.send:disabled { background: #c9ced8; cursor: default; transform: none; }
.fineprint { margin: 8px 0 2px; font-size: 11px; color: var(--ink-faint); text-align: center; }
