:root {
  --primary: #C4623F;
  --primary-ink: #fff;
  --primary-soft: #F6E6DE;
  --bg: #FAF8F5;
  --card: #FFFFFF;
  --card-2: #F3F0EB;
  --line: #ECE7E0;
  --text-1: #22201C;
  --text-2: #6E6A62;
  --text-3: #A19C92;
  --ok: #2F9E6A;
  --ok-soft: #DDF3E8;
  --warn: #C98A12;
  --warn-soft: #FBEFD3;
  --err: #D0453C;
  --err-soft: #FBE1DE;
  --term: #1E1D1B;
  --term-text: #E7E3DA;
  --user: #EFE7DF;
  --shadow: 0 4px 16px rgba(80, 50, 20, .06);
  --shadow-2: 0 10px 40px rgba(60, 40, 20, .16);
  --r-sm: 10px; --r: 16px; --r-lg: 22px;
  --font: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace;
  --pastel-1: #FFE7D6; --pastel-2: #E4E9FF; --pastel-3: #DDF3E8; --pastel-4: #FDE0E0; --pastel-5: #EDE3FF; --pastel-6: #D8F1F3;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --primary: #E07A55; --primary-soft: #3A2A22;
    --bg: #1C1B19; --card: #262522; --card-2: #2F2D29; --line: #36342F;
    --text-1: #EEEBE4; --text-2: #A9A499; --text-3: #77736A;
    --ok-soft: #1F3A2D; --warn-soft: #3D3119; --err-soft: #43231F;
    --term: #121110; --user: #34302B;
    --shadow: 0 4px 16px rgba(0,0,0,.25); --shadow-2: 0 10px 40px rgba(0,0,0,.5);
    --pastel-1: #43302A; --pastel-2: #2C3150; --pastel-3: #213D30; --pastel-4: #472A2A; --pastel-5: #372C4C; --pastel-6: #1F3B3E;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --primary: #E07A55; --primary-soft: #3A2A22;
  --bg: #1C1B19; --card: #262522; --card-2: #2F2D29; --line: #36342F;
  --text-1: #EEEBE4; --text-2: #A9A499; --text-3: #77736A;
  --ok-soft: #1F3A2D; --warn-soft: #3D3119; --err-soft: #43231F;
  --term: #121110; --user: #34302B;
  --shadow: 0 4px 16px rgba(0,0,0,.25); --shadow-2: 0 10px 40px rgba(0,0,0,.5);
  --pastel-1: #43302A; --pastel-2: #2C3150; --pastel-3: #213D30; --pastel-4: #472A2A; --pastel-5: #372C4C; --pastel-6: #1F3B3E;
  color-scheme: dark;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; overflow: hidden; }
body { background: var(--bg); color: var(--text-1); font: 15px/1.55 var(--font); -webkit-font-smoothing: antialiased; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; padding: 0; }
input, textarea, select { font: inherit; color: var(--text-1); }
[hidden] { display: none !important; }
.muted { color: var(--text-2); }
i[data-i] { display: inline-flex; width: 20px; height: 20px; flex: none; }
i[data-i] svg { width: 100%; height: 100%; }

/* ---------- tombol ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 44px; padding: 0 18px;
  border-radius: 12px; font-weight: 600; background: var(--card-2); }
.btn.primary { background: var(--primary); color: var(--primary-ink); }
.btn.block { width: 100%; }
.btn.ghost { background: transparent; border: 1px solid var(--line); }
.btn.danger { background: var(--err); color: #fff; }
.btn.sm { height: 36px; padding: 0 14px; font-size: 14px; border-radius: 10px; }
.btn:active { transform: scale(.98); }
.icon-btn { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; color: var(--text-2); flex: none; }
.icon-btn:active { background: var(--card-2); }
.icon-btn.primary-ic { background: var(--primary); color: #fff; }

.logo-mark { width: 28px; height: 28px; border-radius: 9px; background:
  radial-gradient(circle at 30% 30%, #F2A27F 0, transparent 55%), var(--primary);
  position: relative; flex: none; }
.logo-mark::after { content: ""; position: absolute; inset: 7px; border: 2.5px solid #fff; border-radius: 50%;
  border-right-color: transparent; transform: rotate(45deg); }
.logo-mark.big { width: 56px; height: 56px; border-radius: 18px; margin: 0 auto 16px; }
.logo-mark.big::after { inset: 15px; border-width: 4px; }

/* ---------- login ---------- */
.login { height: 100%; display: grid; place-items: center; padding: 24px 16px; }
.login-card { width: 100%; max-width: 360px; text-align: center; }
.login h1 { margin: 0 0 4px; font-size: 24px; }
.login form { margin-top: 28px; display: grid; gap: 12px; }
.login input { height: 52px; border-radius: 14px; border: 1px solid var(--line); background: var(--card); padding: 0 16px; font-size: 16px; outline: none; box-shadow: var(--shadow); }
.login input:focus { border-color: var(--primary); }
.err { color: var(--err); font-size: 14px; margin: 0; }

/* ---------- tata letak ---------- */
.app { height: 100%; display: flex; }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; height: 100%; position: relative; }
.drawer { width: 300px; background: var(--card); border-right: 1px solid var(--line); display: flex; flex-direction: column;
  padding: calc(env(safe-area-inset-top) + 12px) 12px calc(env(safe-area-inset-bottom) + 12px); gap: 12px; z-index: 30; }
.drawer-head { display: flex; align-items: center; justify-content: space-between; padding: 0 4px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 18px; }
.search { display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 12px; border-radius: 12px; background: var(--card-2); color: var(--text-3); }
.search input { border: 0; background: none; outline: none; flex: 1; min-width: 0; font-size: 14px; }
.conv-list { flex: 1; overflow-y: auto; margin: 0 -4px; padding: 0 4px; overscroll-behavior: contain; }
.conv-group { font-size: 11px; font-weight: 600; letter-spacing: .6px; text-transform: uppercase; color: var(--text-3); padding: 12px 8px 4px; }
.conv-item { display: flex; align-items: center; gap: 8px; width: 100%; text-align: left; padding: 10px 8px 10px 12px; border-radius: 12px; font-size: 14px; color: var(--text-1); }
.conv-item span { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conv-item.active { background: var(--primary-soft); color: var(--primary); font-weight: 600; }
.conv-item .more { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; color: var(--text-3); }
.conv-item .more i { width: 16px; height: 16px; }
.conv-item .run-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--primary); animation: pulse 1.2s infinite; }
.drawer-foot { border-top: 1px solid var(--line); padding-top: 8px; display: grid; }
.row-btn { display: flex; align-items: center; gap: 12px; height: 44px; padding: 0 8px; border-radius: 10px; color: var(--text-2); font-size: 14px; }
.row-btn:active { background: var(--card-2); }
.scrim { display: none; }

@media (max-width: 860px) {
  .drawer { position: fixed; inset: 0 auto 0 0; width: min(86vw, 320px); transform: translateX(-102%); transition: transform .25s ease; box-shadow: var(--shadow-2); border: 0; }
  .app.drawer-open .drawer { transform: none; }
  .app.drawer-open .scrim { display: block; position: fixed; inset: 0; background: rgba(20,15,10,.35); z-index: 25; }
}
@media (min-width: 861px) { .hide-desk { display: none !important; } }

/* ---------- topbar ---------- */
.topbar { display: flex; align-items: center; gap: 4px; padding: calc(env(safe-area-inset-top) + 6px) 8px 6px; background: var(--bg); z-index: 5; }
.title-wrap { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; padding-left: 4px; }
.conv-title { font-weight: 600; font-size: 15px; max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.model-chip { display: inline-flex; align-items: center; gap: 2px; font-size: 12px; color: var(--text-2); }
.model-chip i { width: 14px; height: 14px; }
.stat-pill { display: flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border-radius: 999px; background: var(--card); box-shadow: var(--shadow); font-size: 12px; font-weight: 600; color: var(--text-2); font-variant-numeric: tabular-nums; }
.stat-pill .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); }
.stat-pill.warn .dot { background: var(--warn); }
.stat-pill.bad .dot { background: var(--err); }
.stats-bar { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; padding: 4px 16px 12px; }
.stats-bar .sb { background: var(--card); border-radius: 14px; padding: 10px; box-shadow: var(--shadow); }
.sb .k { font-size: 11px; color: var(--text-3); font-weight: 600; letter-spacing: .4px; text-transform: uppercase; }
.sb .v { font-size: 17px; font-weight: 700; font-variant-numeric: tabular-nums; }
.sb .bar { height: 4px; border-radius: 4px; background: var(--card-2); margin-top: 6px; overflow: hidden; }
.sb .bar b { display: block; height: 100%; border-radius: 4px; background: var(--ok); }

/* ---------- thread ---------- */
.scroller { flex: 1; overflow-y: auto; overscroll-behavior: contain; scroll-behavior: auto; }
.thread { max-width: 780px; margin: 0 auto; padding: 8px 16px 24px; }
.msg { margin: 16px 0; }
.msg.user { display: flex; flex-direction: column; align-items: flex-end; }
.bubble { background: var(--user); padding: 10px 14px; border-radius: 20px 20px 6px 20px; max-width: 86%; white-space: pre-wrap; word-wrap: break-word; }
.user-atts { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; margin-bottom: 6px; max-width: 86%; }
.user-atts img { width: 96px; height: 96px; object-fit: cover; border-radius: 14px; cursor: zoom-in; }
.file-chip { display: inline-flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 12px; background: var(--card); box-shadow: var(--shadow); font-size: 13px; max-width: 240px; color: var(--text-1); text-decoration: none; }
.file-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-chip i { color: var(--primary); }

.msg.assistant .md { word-wrap: break-word; }
.md > :first-child { margin-top: 0; }
.md > :last-child { margin-bottom: 0; }
.md p { margin: 0 0 10px; }
.md ul, .md ol { padding-left: 22px; margin: 6px 0 10px; }
.md li { margin: 3px 0; }
.md h1, .md h2, .md h3 { font-size: 16px; margin: 16px 0 6px; }
.md a { color: var(--primary); }
.md code { font-family: var(--mono); font-size: 13px; background: var(--card-2); padding: 1px 5px; border-radius: 6px; }
.md pre { position: relative; background: var(--term); color: var(--term-text); border-radius: 14px; padding: 12px 14px; overflow-x: auto; font-size: 12.5px; line-height: 1.5; margin: 8px 0 12px; }
.md pre code { background: none; padding: 0; font-size: inherit; color: inherit; }
.md pre .copy { position: absolute; top: 6px; right: 6px; font-size: 11px; padding: 4px 8px; border-radius: 8px; background: rgba(255,255,255,.1); color: #ddd; }
.md table { border-collapse: collapse; font-size: 13px; display: block; overflow-x: auto; margin: 8px 0; }
.md th, .md td { border: 1px solid var(--line); padding: 6px 10px; text-align: left; }
.md blockquote { margin: 8px 0; padding: 4px 12px; border-left: 3px solid var(--primary); color: var(--text-2); }
.cursor::after { content: ""; display: inline-block; width: 8px; height: 16px; margin-left: 2px; vertical-align: -3px; background: var(--primary); border-radius: 2px; animation: blink 1s steps(2) infinite; }

.msg-actions { display: flex; gap: 2px; margin-top: 4px; margin-left: -8px; }
.msg-actions .icon-btn { width: 34px; height: 34px; color: var(--text-3); }
.msg-actions .icon-btn i { width: 17px; height: 17px; }
.msg-actions .cost { font-size: 11px; color: var(--text-3); align-self: center; margin-left: 6px; }

/* thinking */
.think { margin: 4px 0 10px; }
.think summary { list-style: none; display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-2); cursor: pointer; padding: 4px 10px 4px 8px; border-radius: 999px; background: var(--card-2); }
.think summary::-webkit-details-marker { display: none; }
.think summary i { width: 15px; height: 15px; }
.think .tbody { font-size: 13px; color: var(--text-2); border-left: 2px solid var(--line); padding: 4px 0 4px 12px; margin: 8px 0 0 10px; white-space: pre-wrap; }
.think.live summary { color: var(--primary); }
.think.live summary i { animation: spin 1.6s linear infinite; }

/* tool card */
.tool { background: var(--card); border-radius: var(--r); box-shadow: var(--shadow); margin: 8px 0 12px; overflow: hidden; }
.tool-head { display: flex; align-items: center; gap: 10px; padding: 10px 12px; width: 100%; text-align: left; }
.tool-ic { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; flex: none; background: var(--pastel-2); color: var(--text-1); }
.tool-ic i { width: 17px; height: 17px; }
.tool-ic.k-run { background: var(--pastel-1); } .tool-ic.k-file { background: var(--pastel-5); } .tool-ic.k-web { background: var(--pastel-6); }
.tool-ic.k-viz { background: var(--pastel-3); } .tool-ic.k-mem { background: var(--pastel-4); }
.tool-meta { flex: 1; min-width: 0; }
.tool-name { font-size: 13px; font-weight: 600; }
.tool-sub { font-family: var(--mono); font-size: 12px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.badge { font-size: 11px; font-weight: 600; padding: 3px 8px; border-radius: 999px; background: var(--card-2); color: var(--text-2); white-space: nowrap; display: inline-flex; align-items: center; gap: 4px; }
.badge.run { background: var(--primary-soft); color: var(--primary); }
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.err { background: var(--err-soft); color: var(--err); }
.badge.wait { background: var(--warn-soft); color: var(--warn); }
.badge .spin { width: 10px; height: 10px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .8s linear infinite; }
.tool-body { border-top: 1px solid var(--line); }
.term { background: var(--term); color: var(--term-text); font: 12px/1.5 var(--mono); padding: 10px 12px; max-height: 320px; overflow: auto; white-space: pre-wrap; word-break: break-all; margin: 0; }
.term .cmd { color: #F2A27F; }
.tool-input { font: 12px/1.5 var(--mono); padding: 10px 12px; white-space: pre-wrap; word-break: break-word; color: var(--text-2); max-height: 240px; overflow: auto; margin: 0; background: var(--card-2); }
.approval { padding: 12px; background: var(--warn-soft); }
.approval p { margin: 0 0 10px; font-size: 13px; font-weight: 600; color: var(--warn); display: flex; gap: 6px; align-items: center; }
.approval .acts { display: flex; gap: 8px; flex-wrap: wrap; }
.approval pre { font: 12px/1.5 var(--mono); background: var(--term); color: var(--term-text); padding: 10px; border-radius: 10px; margin: 0 0 10px; white-space: pre-wrap; word-break: break-all; max-height: 200px; overflow: auto; }
.results { display: flex; flex-wrap: wrap; gap: 6px; padding: 10px 12px; }
.results a { font-size: 12px; padding: 5px 10px; border-radius: 999px; background: var(--card-2); color: var(--text-1); text-decoration: none; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.displays:empty { display: none; }
.note { font-size: 13px; padding: 8px 12px; border-radius: 12px; margin: 8px 0; background: var(--card-2); color: var(--text-2); }
.note.warn { background: var(--warn-soft); color: var(--warn); }
.note.error { background: var(--err-soft); color: var(--err); }

/* tampilan kaya */
.rich { margin: 8px 0 12px; background: var(--card); border-radius: var(--r); box-shadow: var(--shadow); padding: 14px; }
.rich h4 { margin: 0 0 10px; font-size: 14px; }
.gauges { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.gauge { text-align: center; }
.gauge svg { width: 100%; max-width: 72px; aspect-ratio: 1; }
.gauge .gv { font-size: 13px; font-weight: 700; margin-top: -2px; font-variant-numeric: tabular-nums; }
.gauge .gk { font-size: 11px; color: var(--text-3); }
.ct-list { margin-top: 14px; display: grid; gap: 2px; }
.ct { display: flex; align-items: center; gap: 8px; font-size: 13px; padding: 6px 2px; border-bottom: 1px solid var(--line); }
.ct:last-child { border: 0; }
.ct .d { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); flex: none; }
.ct.down .d { background: var(--err); }
.ct b { font-weight: 600; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ct span { color: var(--text-3); font-size: 12px; white-space: nowrap; }
.sys-line { font-size: 12px; color: var(--text-2); margin-top: 10px; }
.chart-box { position: relative; height: 240px; }
.tbl-wrap { overflow-x: auto; margin: 0 -14px; padding: 0 14px; }
.tbl { border-collapse: collapse; font-size: 12.5px; width: 100%; }
.tbl th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .4px; color: var(--text-3); padding: 6px 8px; border-bottom: 1px solid var(--line); cursor: pointer; white-space: nowrap; }
.tbl td { padding: 7px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; font-variant-numeric: tabular-nums; }
.tbl tr:last-child td { border: 0; }
.shot { display: block; width: 100%; border-radius: 12px; cursor: zoom-in; background: var(--card-2); }
.cap { font-size: 12px; color: var(--text-2); margin-top: 6px; display: flex; gap: 8px; align-items: center; justify-content: space-between; }
.cap a { color: var(--primary); font-weight: 600; text-decoration: none; }
.diff { font: 12px/1.5 var(--mono); border-radius: 10px; overflow: auto; max-height: 280px; background: var(--term); }
.diff div { padding: 0 10px; white-space: pre-wrap; word-break: break-all; }
.diff .del { background: rgba(208,69,60,.22); color: #F3B8B2; }
.diff .add { background: rgba(47,158,106,.22); color: #AEE5C8; }

/* empty state */
.empty { max-width: 560px; margin: 0 auto; padding: 8vh 16px 24px; text-align: center; }
.empty h2 { margin: 0 0 4px; font-size: 22px; }
.quick { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 28px; text-align: left; }
.quick button { background: var(--card); border-radius: var(--r); padding: 14px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 2px; }
.quick button:active { transform: scale(.98); }
.quick b { font-size: 14px; margin-top: 8px; }
.quick span { font-size: 12px; color: var(--text-2); }
.qi { width: 36px !important; height: 36px !important; border-radius: 12px; padding: 8px; }
.qi.c1 { background: var(--pastel-3); } .qi.c2 { background: var(--pastel-2); } .qi.c3 { background: var(--pastel-1); }
.qi.c4 { background: var(--pastel-4); } .qi.c5 { background: var(--pastel-5); } .qi.c6 { background: var(--pastel-6); }

/* composer */
.composer-wrap { padding: 8px 12px calc(env(safe-area-inset-bottom) + 10px); background: linear-gradient(to top, var(--bg) 75%, transparent); }
.composer { max-width: 780px; margin: 0 auto; display: flex; align-items: flex-end; gap: 4px; background: var(--card); border-radius: 24px; padding: 6px; box-shadow: var(--shadow-2); border: 1px solid var(--line); }
.composer textarea { flex: 1; min-width: 0; border: 0; outline: none; background: none; resize: none; padding: 9px 4px; max-height: 180px; font-size: 16px; line-height: 1.4; }
.send-btn { width: 40px; height: 40px; border-radius: 50%; background: var(--primary); color: #fff; display: grid; place-items: center; flex: none; transition: transform .15s; }
.send-btn:disabled { opacity: .35; }
.send-btn.stop { background: var(--text-1); color: var(--bg); }
.send-btn:active { transform: scale(.92); }
#micBtn.on { color: var(--err); }
.attach-row { max-width: 780px; margin: 0 auto 8px; display: flex; gap: 8px; overflow-x: auto; padding: 2px; }
.att { position: relative; flex: none; width: 64px; height: 64px; border-radius: 14px; background: var(--card); box-shadow: var(--shadow); display: grid; place-items: center; overflow: hidden; font-size: 10px; text-align: center; color: var(--text-2); padding: 4px; }
.att img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.att .x { position: absolute; top: 3px; right: 3px; width: 20px; height: 20px; border-radius: 50%; background: rgba(0,0,0,.6); color: #fff; display: grid; place-items: center; z-index: 2; }
.att .x i { width: 12px; height: 12px; }
.att.loading::after { content: ""; position: absolute; inset: 0; background: rgba(255,255,255,.5); }
.rec-bar { max-width: 780px; margin: 0 auto 8px; display: flex; align-items: center; gap: 10px; background: var(--card); border-radius: 18px; padding: 6px 6px 6px 16px; box-shadow: var(--shadow-2); }
.rec-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--err); animation: pulse 1s infinite; }
#recTime { font-variant-numeric: tabular-nums; font-weight: 600; font-size: 14px; }
#recWave { flex: 1; min-width: 0; height: 28px; }
.to-bottom { position: absolute; right: 16px; bottom: 96px; width: 40px; height: 40px; border-radius: 50%; background: var(--card); box-shadow: var(--shadow-2); display: grid; place-items: center; color: var(--text-2); z-index: 4; }

/* sheet */
.sheet { position: fixed; inset: 0; z-index: 50; }
.sheet-scrim { position: absolute; inset: 0; background: rgba(20,15,10,.4); animation: fade .2s; }
.sheet-body { position: absolute; left: 0; right: 0; bottom: 0; max-height: 88vh; overflow-y: auto; background: var(--card); border-radius: 24px 24px 0 0; padding: 8px 16px calc(env(safe-area-inset-bottom) + 20px); animation: up .25s ease; max-width: 560px; margin: 0 auto; }
.grab { width: 40px; height: 4px; border-radius: 4px; background: var(--line); margin: 4px auto 12px; }
.sheet h3 { margin: 4px 0 16px; font-size: 18px; }
.field { margin-bottom: 18px; }
.field > label { display: block; font-size: 12px; font-weight: 600; color: var(--text-2); margin-bottom: 8px; letter-spacing: .3px; }
.seg { display: flex; background: var(--card-2); border-radius: 12px; padding: 3px; gap: 2px; }
.seg button { flex: 1; height: 36px; border-radius: 10px; font-size: 13px; font-weight: 600; color: var(--text-2); }
.seg button.on { background: var(--card); color: var(--primary); box-shadow: var(--shadow); }
.hint { font-size: 12px; color: var(--text-3); margin-top: 6px; }
.opt-list { display: grid; gap: 8px; }
.opt { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 14px; border: 1.5px solid var(--line); text-align: left; }
.opt.on { border-color: var(--primary); background: var(--primary-soft); }
.opt b { display: block; font-size: 14px; }
.opt span { font-size: 12px; color: var(--text-2); }
.sheet textarea { width: 100%; min-height: 180px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg); padding: 10px; font: 12.5px/1.5 var(--mono); outline: none; }
.sheet input[type=text] { width: 100%; height: 46px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg); padding: 0 12px; outline: none; font-size: 16px; }
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; font-size: 14px; }
.switch { width: 46px; height: 28px; border-radius: 999px; background: var(--line); position: relative; flex: none; transition: background .2s; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; transition: transform .2s; box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.switch.on { background: var(--primary); }
.switch.on::after { transform: translateX(18px); }
.menu-list { display: grid; }
.menu-list button { display: flex; align-items: center; gap: 12px; height: 52px; padding: 0 4px; font-size: 15px; border-bottom: 1px solid var(--line); text-align: left; }
.menu-list button:last-child { border: 0; }
.menu-list .red { color: var(--err); }

.lightbox { position: fixed; inset: 0; background: rgba(0,0,0,.92); z-index: 60; display: grid; place-items: center; padding: 16px; }
.lightbox img { max-width: 100%; max-height: 100%; border-radius: 8px; }
.toast { position: fixed; left: 50%; bottom: calc(env(safe-area-inset-bottom) + 100px); transform: translateX(-50%); background: var(--text-1); color: var(--bg); padding: 10px 16px; border-radius: 12px; font-size: 14px; z-index: 70; box-shadow: var(--shadow-2); max-width: calc(100% - 32px); }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { 50% { opacity: .35; } }
@keyframes blink { 50% { opacity: 0; } }
@keyframes fade { from { opacity: 0; } }
@keyframes up { from { transform: translateY(40px); opacity: 0; } }

@media (max-width: 420px) {
  .thread { padding: 4px 14px 20px; }
  .stats-bar { grid-template-columns: repeat(2, 1fr); }
}

/* ukuran ikon SVG yang disisipkan langsung */
button > svg, a > svg, summary > svg, .tool-ic > svg, .file-chip > svg, .menu-list svg { width: 20px; height: 20px; flex: none; }
.send-btn > svg { width: 20px; height: 20px; }
.msg-actions .icon-btn > svg { width: 17px; height: 17px; }
.think summary > svg { width: 15px; height: 15px; }
.tool-ic > svg { width: 17px; height: 17px; }
.conv-item .more > svg { width: 16px; height: 16px; }
.att > svg { width: 18px; height: 18px; }
.approval p > svg { width: 16px; height: 16px; }
.att .x > svg { width: 12px; height: 12px; }
.think.live summary > svg { animation: spin 1.6s linear infinite; }
.tool .rich { box-shadow: none; margin: 0; border-radius: 0; border-top: 1px solid var(--line); }
