/* ==========================================================================
   Agent Console — design system
   Grafit gelap + aksen champagne gold. Inter untuk UI, Instrument Serif
   untuk judul, JetBrains Mono untuk kode/angka teknis.
   ========================================================================== */

:root {
  --bg: #08080a;
  --bg-2: #0d0d10;
  --panel: #111114;
  --panel-2: #16161a;
  --panel-3: #1c1c21;
  --line: rgba(255, 255, 255, 0.06);
  --line-2: rgba(255, 255, 255, 0.1);
  --line-3: rgba(255, 255, 255, 0.16);
  --text: #ececee;
  --text-2: #c4c4ca;
  --muted: #8d8d96;
  --faint: #5e5e66;

  --gold: #d6b67c;
  --gold-hi: #f0dcb0;
  --gold-lo: #9c7c48;
  --gold-grad: linear-gradient(135deg, #f3e2b8 0%, #d6b67c 45%, #a07f4a 100%);
  --gold-soft: rgba(214, 182, 124, 0.1);
  --gold-line: rgba(214, 182, 124, 0.28);

  --ok: #6fd3a5;
  --warn: #e9bb62;
  --err: #ef7a72;
  --info: #8fb4ff;

  --r-sm: 8px;
  --r: 12px;
  --r-lg: 18px;
  --r-xl: 24px;

  --shadow: 0 1px 0 rgba(255, 255, 255, 0.03) inset, 0 20px 50px -20px rgba(0, 0, 0, 0.7);
  --shadow-lg: 0 1px 0 rgba(255, 255, 255, 0.04) inset, 0 40px 80px -30px rgba(0, 0, 0, 0.85);

  --font: 'Inter', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --serif: 'Instrument Serif', 'Iowan Old Style', Georgia, serif;
  --mono: 'JetBrains Mono', ui-monospace, 'Cascadia Code', Consolas, monospace;

  --side-w: 256px;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.55 var(--font);
  font-feature-settings: 'cv11', 'ss01', 'ss03';
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow: hidden;
}
body::before {
  content: '';
  position: fixed; inset: 0;
  pointer-events: none;
  background:
    radial-gradient(900px 500px at 78% -10%, rgba(214, 182, 124, 0.07), transparent 60%),
    radial-gradient(700px 500px at -10% 110%, rgba(120, 130, 170, 0.05), transparent 60%);
  z-index: 0;
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
::selection { background: rgba(214, 182, 124, 0.3); color: #fff; }
svg { display: block; flex-shrink: 0; }

* { scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.1) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,.08); border-radius: 10px; border: 3px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background-color: rgba(255,255,255,.16); }

.ico { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.ico-sm { width: 15px; height: 15px; }
.ico-lg { width: 22px; height: 22px; }

/* ---------- boot ---------- */
.boot { height: 100vh; display: grid; place-items: center; }
.boot-mark { width: 42px; height: 42px; border-radius: 12px; background: var(--gold-grad); animation: breathe 1.6s var(--ease) infinite; }
@keyframes breathe { 50% { opacity: .45; transform: scale(.92); } }

/* ---------- shell ---------- */
.shell { position: relative; z-index: 1; display: grid; grid-template-columns: var(--side-w) 1fr; height: 100vh; }

.side {
  display: flex; flex-direction: column;
  background: linear-gradient(180deg, rgba(255,255,255,.012), transparent 30%), var(--bg-2);
  border-right: 1px solid var(--line);
  padding: 20px 14px 14px;
  min-height: 0;
}
.brandmark { display: flex; align-items: center; gap: 12px; padding: 4px 8px 22px; }
.brandmark-logo {
  width: 36px; height: 36px; border-radius: 10px;
  background: var(--gold-grad);
  display: grid; place-items: center;
  box-shadow: 0 8px 24px -8px rgba(214, 182, 124, .55), inset 0 1px 0 rgba(255,255,255,.5);
  color: #241a0a;
}
.brandmark-logo svg { width: 18px; height: 18px; stroke-width: 2; }
.brandmark-name { font-family: var(--serif); font-size: 21px; line-height: 1; letter-spacing: .2px; }
.brandmark-org { font-size: 10.5px; letter-spacing: .18em; text-transform: uppercase; color: var(--muted); margin-top: 5px; }

.nav-label { font-size: 10.5px; letter-spacing: .16em; text-transform: uppercase; color: var(--faint); padding: 0 12px 8px; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a {
  position: relative;
  display: flex; align-items: center; gap: 12px;
  padding: 9px 12px;
  border-radius: 10px;
  color: var(--muted);
  font-weight: 500;
  transition: color .2s, background .2s;
}
.nav a:hover { color: var(--text); background: rgba(255,255,255,.03); }
.nav a.active { color: var(--text); background: linear-gradient(90deg, rgba(214,182,124,.12), rgba(214,182,124,.02)); }
.nav a.active::before {
  content: ''; position: absolute; left: -14px; top: 9px; bottom: 9px; width: 2px; border-radius: 2px;
  background: var(--gold-grad);
}
.nav a.active .ico { color: var(--gold); }
.nav-count { margin-left: auto; font-size: 11px; color: var(--faint); font-variant-numeric: tabular-nums; }

.side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 10px; }
.meter-card {
  padding: 14px; border-radius: var(--r);
  background: var(--panel); border: 1px solid var(--line);
}
.meter-top { display: flex; justify-content: space-between; align-items: baseline; font-size: 12px; color: var(--muted); }
.meter-top b { color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }
.meter { height: 4px; border-radius: 4px; background: rgba(255,255,255,.06); margin-top: 10px; overflow: hidden; }
.meter > i { display: block; height: 100%; border-radius: inherit; background: var(--gold-grad); transition: width .6s var(--ease); }
.meter.warn > i { background: linear-gradient(90deg, #e9bb62, #ef7a72); }
.meter-sub { font-size: 11px; color: var(--faint); margin-top: 8px; }

.me-row { display: flex; align-items: center; gap: 4px; }
.me-row .me { flex: 1; min-width: 0; }
.me-text { min-width: 0; }
.me-name, .me-sub { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: var(--r); transition: background .2s; }
.me:hover { background: rgba(255,255,255,.03); }
.me-name { font-weight: 600; font-size: 13px; }
.me-sub { font-size: 11.5px; color: var(--muted); }
.engine-dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; margin-right: 6px; background: var(--faint); vertical-align: 1px; }
.engine-dot.on { background: var(--ok); box-shadow: 0 0 0 3px rgba(111, 211, 165, .15); }
.engine-dot.off { background: var(--err); box-shadow: 0 0 0 3px rgba(239, 122, 114, .15); }

.main { min-width: 0; min-height: 0; display: flex; flex-direction: column; }
.page { flex: 1; min-height: 0; overflow-y: auto; }
.page-inner { max-width: 1180px; margin: 0 auto; padding: 40px 44px 80px; }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 32px; }
.eyebrow { font-size: 11px; letter-spacing: .2em; text-transform: uppercase; color: var(--gold); margin-bottom: 10px; display: flex; align-items: center; gap: 10px; }
.eyebrow::before { content: ''; width: 18px; height: 1px; background: var(--gold-line); }
.display { font-family: var(--serif); font-weight: 400; font-size: 44px; line-height: 1.02; letter-spacing: -.4px; margin: 0; }
.display em { font-style: italic; background: var(--gold-grad); -webkit-background-clip: text; background-clip: text; color: transparent; padding-right: 2px; }
.lead { color: var(--muted); margin: 12px 0 0; max-width: 560px; font-size: 14.5px; }
.head-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

.page.page-chat { overflow: hidden; }
.page-chat .chat { height: 100%; }

/* ---------- buttons & inputs ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 38px; padding: 0 16px;
  border-radius: 10px;
  border: 1px solid var(--line-2);
  background: rgba(255,255,255,.03);
  font-weight: 500; font-size: 13.5px;
  white-space: nowrap;
  transition: background .2s, border-color .2s, transform .1s, box-shadow .2s, opacity .2s;
}
.btn:hover { background: rgba(255,255,255,.06); border-color: var(--line-3); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .45; pointer-events: none; }
.btn .ico { width: 16px; height: 16px; }
.btn-gold {
  background: var(--gold-grad); color: #1d1508; border-color: transparent; font-weight: 600;
  box-shadow: 0 10px 30px -12px rgba(214, 182, 124, .6), inset 0 1px 0 rgba(255,255,255,.45);
}
.btn-gold:hover { background: var(--gold-grad); filter: brightness(1.06); border-color: transparent; }
.btn-gold .typing i { background: #1d1508; }
.btn .typing { padding: 0; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn-ghost:hover { color: var(--text); background: rgba(255,255,255,.04); border-color: transparent; }
.btn-danger { color: var(--err); border-color: rgba(239,122,114,.25); background: rgba(239,122,114,.06); }
.btn-danger:hover { background: rgba(239,122,114,.12); border-color: rgba(239,122,114,.4); }
.btn-sm { height: 32px; padding: 0 12px; font-size: 12.5px; border-radius: 9px; }
.btn-block { width: 100%; }

.icon-btn {
  width: 34px; height: 34px; display: inline-grid; place-items: center;
  border-radius: 9px; border: 1px solid transparent; background: transparent; color: var(--muted);
  transition: all .2s;
}
.icon-btn:hover { color: var(--text); background: rgba(255,255,255,.05); border-color: var(--line); }
.icon-btn.on { color: var(--gold); }
.icon-btn.danger:hover { color: var(--err); background: rgba(239,122,114,.08); }
.icon-btn .ico { width: 17px; height: 17px; }

.field { display: flex; flex-direction: column; gap: 7px; }
.field > span, .label { font-size: 12px; font-weight: 500; color: var(--text-2); }
.field small, .help { font-size: 11.5px; color: var(--faint); line-height: 1.5; }
.input, .select, .textarea {
  width: 100%;
  background: var(--bg-2);
  border: 1px solid var(--line-2);
  border-radius: 10px;
  padding: 10px 12px;
  outline: none;
  transition: border-color .2s, box-shadow .2s, background .2s;
}
.input, .select { height: 40px; }
.textarea { resize: vertical; min-height: 96px; line-height: 1.55; }
.input::placeholder, .textarea::placeholder { color: var(--faint); }
.input:focus, .select:focus, .textarea:focus { border-color: var(--gold-line); box-shadow: 0 0 0 4px rgba(214,182,124,.08); background: #0b0b0e; }
.input.mono { font-family: var(--mono); font-size: 12.5px; }
.select { appearance: none; padding-right: 34px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238d8d96' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; }
.select option { background: #141418; }
.input-wrap { position: relative; }
.input-wrap .input { padding-left: 38px; }
.input-wrap .ico { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--faint); width: 16px; height: 16px; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.row { display: flex; align-items: center; gap: 10px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.mono { font-family: var(--mono); }
.num { font-variant-numeric: tabular-nums; }

/* segmented */
.seg { display: inline-flex; padding: 3px; border-radius: 11px; background: var(--bg-2); border: 1px solid var(--line-2); gap: 2px; }
.seg button {
  border: 0; background: transparent; color: var(--muted);
  height: 30px; padding: 0 12px; border-radius: 8px; font-size: 12.5px; font-weight: 500;
  display: inline-flex; align-items: center; gap: 6px;
  transition: all .2s;
}
.seg button:hover { color: var(--text); }
.seg button.on { background: var(--panel-3); color: var(--text); box-shadow: 0 1px 0 rgba(255,255,255,.05) inset, 0 4px 12px -4px rgba(0,0,0,.6); }
.seg button.on .dot { background: var(--gold); }
.seg .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--faint); }

/* switch */
.switch { position: relative; display: inline-flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch i { width: 36px; height: 20px; border-radius: 20px; background: rgba(255,255,255,.1); position: relative; transition: background .25s; flex-shrink: 0; }
.switch i::after { content: ''; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #e8e8ea; transition: transform .25s var(--ease); box-shadow: 0 2px 6px rgba(0,0,0,.4); }
.switch input:checked + i { background: var(--gold); }
.switch input:checked + i::after { transform: translateX(16px); background: #fff; }
.switch input:focus-visible + i { box-shadow: 0 0 0 4px rgba(214,182,124,.15); }

/* chips / badges */
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  height: 24px; padding: 0 9px; border-radius: 7px;
  font-size: 11.5px; font-weight: 500; color: var(--text-2);
  background: rgba(255,255,255,.04); border: 1px solid var(--line);
  white-space: nowrap;
}
.chip-gold { color: var(--gold-hi); background: var(--gold-soft); border-color: var(--gold-line); }
.chip-ok { color: var(--ok); background: rgba(111,211,165,.08); border-color: rgba(111,211,165,.22); }
.chip-warn { color: var(--warn); background: rgba(233,187,98,.08); border-color: rgba(233,187,98,.22); }
.chip-err { color: var(--err); background: rgba(239,122,114,.08); border-color: rgba(239,122,114,.22); }
.chip .ico { width: 13px; height: 13px; }
.chip-dot { width: 7px; height: 7px; border-radius: 50%; background: linear-gradient(135deg, var(--tone-a), var(--tone-b)); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip-toggle { cursor: pointer; transition: all .2s; height: 30px; padding: 0 12px; border-radius: 9px; }
.chip-toggle:hover { border-color: var(--line-3); color: var(--text); }
.chip-toggle.on { color: var(--gold-hi); background: var(--gold-soft); border-color: var(--gold-line); }

/* tones (warna agent & brand) */
.tone-gold { --tone-a: #f3e2b8; --tone-b: #a07f4a; --tone-ink: #241a0a; }
.tone-emerald { --tone-a: #9ef0c8; --tone-b: #1f7a5a; --tone-ink: #062417; }
.tone-sapphire { --tone-a: #b8ccff; --tone-b: #3552a8; --tone-ink: #0a1430; }
.tone-amethyst { --tone-a: #dcc4ff; --tone-b: #6b43b0; --tone-ink: #1b0c33; }
.tone-rose { --tone-a: #ffc6cf; --tone-b: #b04a63; --tone-ink: #33101a; }
.tone-copper { --tone-a: #ffd2b0; --tone-b: #a65a2c; --tone-ink: #2e1606; }
.tone-slate { --tone-a: #d8dbe3; --tone-b: #5b6070; --tone-ink: #14161c; }

.avatar {
  --s: 36px;
  width: var(--s); height: var(--s); flex-shrink: 0;
  border-radius: 30%;
  display: inline-grid; place-items: center;
  background: linear-gradient(140deg, var(--tone-a), var(--tone-b));
  color: var(--tone-ink);
  font-weight: 700; font-size: calc(var(--s) * .38); letter-spacing: .02em;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.45), 0 6px 16px -8px var(--tone-b);
}
.av-xs { --s: 26px; border-radius: 8px; }
.av-sm { --s: 32px; }
.av-lg { --s: 52px; }
.av-xl { --s: 64px; border-radius: 20px; }
.av-stack { display: flex; }
.av-stack .avatar { margin-left: -8px; box-shadow: 0 0 0 2px var(--panel); }
.av-stack .avatar:first-child { margin-left: 0; }

/* ---------- cards ---------- */
.card {
  background: linear-gradient(180deg, rgba(255,255,255,.018), rgba(255,255,255,0) 40%), var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow);
}
.card-pad { padding: 24px; }
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 22px 24px 0; }
.card-title { font-size: 15px; font-weight: 600; margin: 0; letter-spacing: -.1px; display: flex; align-items: center; gap: 10px; }
.card-title .ico { color: var(--gold); }
.card-sub { color: var(--muted); font-size: 13px; margin-top: 4px; }
.card-body { padding: 20px 24px 24px; }
.card-foot { padding: 16px 24px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 10px; }
.divider { height: 1px; background: var(--line); margin: 4px 0; }

.empty {
  text-align: center; padding: 64px 24px; color: var(--muted);
  border: 1px dashed var(--line-2); border-radius: var(--r-lg);
}
.empty .display { font-size: 30px; color: var(--text); margin-bottom: 8px; }
.empty-icon { width: 52px; height: 52px; border-radius: 16px; margin: 0 auto 18px; display: grid; place-items: center; background: var(--gold-soft); color: var(--gold); border: 1px solid var(--gold-line); }

/* ---------- agent & brand grid ---------- */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 18px; }
.tile {
  position: relative; overflow: hidden;
  display: flex; flex-direction: column;
  padding: 22px;
  border-radius: var(--r-lg);
  background: linear-gradient(180deg, rgba(255,255,255,.02), transparent 50%), var(--panel);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  transition: border-color .3s, transform .3s var(--ease), box-shadow .3s;
}
.tile::before {
  content: ''; position: absolute; inset: 0 0 auto 0; height: 120px; pointer-events: none;
  background: radial-gradient(240px 110px at 15% 0%, color-mix(in srgb, var(--tone-b) 26%, transparent), transparent 70%);
  opacity: .8;
}
.tile:hover { border-color: var(--line-2); transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.tile-top { position: relative; display: flex; align-items: flex-start; gap: 14px; }
.tile-name { font-family: var(--serif); font-size: 26px; line-height: 1.05; margin: 2px 0 4px; }
.tile-role { color: var(--muted); font-size: 13px; }
.tile-menu { margin-left: auto; display: flex; gap: 2px; opacity: 0; transition: opacity .2s; }
.tile:hover .tile-menu, .tile:focus-within .tile-menu { opacity: 1; }
.tile-desc { position: relative; color: var(--text-2); font-size: 13px; margin: 16px 0 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 40px; }
.tile .chips { margin-top: 14px; position: relative; }
.tile-stats { display: grid; grid-template-columns: repeat(3, 1fr); margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line); position: relative; }
.tile-stats div { display: flex; flex-direction: column; gap: 2px; }
.tile-stats b { font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; }
.tile-stats span { font-size: 11px; color: var(--faint); letter-spacing: .04em; text-transform: uppercase; }
.tile-actions { display: flex; gap: 8px; margin-top: 18px; position: relative; }
.tile-actions .btn { flex: 1; }
.tile.inactive { opacity: .6; }
.tile-new {
  border-style: dashed; background: transparent; box-shadow: none; align-items: center; justify-content: center;
  color: var(--muted); min-height: 260px; gap: 10px; cursor: pointer;
}
.tile-new::before { display: none; }
.tile-new:hover { color: var(--gold-hi); border-color: var(--gold-line); background: rgba(214,182,124,.03); }
.tile-new .empty-icon { margin: 0; }

.brand-mono {
  width: 52px; height: 52px; border-radius: 16px; flex-shrink: 0;
  display: grid; place-items: center;
  font-family: var(--serif); font-size: 26px; color: var(--tone-ink);
  background: linear-gradient(140deg, var(--tone-a), var(--tone-b));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.45), 0 10px 24px -12px var(--tone-b);
}
.meta-list { display: flex; flex-direction: column; gap: 8px; margin-top: 16px; position: relative; }
.meta-item { display: flex; align-items: center; gap: 10px; font-size: 12.5px; color: var(--text-2); min-width: 0; }
.meta-item .ico { width: 15px; height: 15px; color: var(--faint); }
.meta-item span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.meta-item.mono span { font-family: var(--mono); font-size: 11.5px; }
.meta-item a:hover { color: var(--gold-hi); }

/* tone picker */
.tones { display: flex; gap: 10px; flex-wrap: wrap; }
.tone-opt {
  width: 30px; height: 30px; border-radius: 10px; border: 0; padding: 0;
  background: linear-gradient(140deg, var(--tone-a), var(--tone-b));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.4);
  outline: 2px solid transparent; outline-offset: 3px; transition: outline-color .2s, transform .2s;
}
.tone-opt:hover { transform: scale(1.06); }
.tone-opt.on { outline-color: var(--gold); }

/* ---------- modal ---------- */
.modal-back {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(4, 4, 6, .66);
  backdrop-filter: blur(8px);
  display: grid; place-items: center;
  padding: 24px;
  animation: fade .2s var(--ease);
}
.modal {
  width: min(620px, 100%); max-height: calc(100vh - 48px);
  display: flex; flex-direction: column;
  background: linear-gradient(180deg, rgba(255,255,255,.025), transparent 30%), #121216;
  border: 1px solid var(--line-2);
  border-radius: var(--r-xl);
  box-shadow: 0 50px 120px -30px rgba(0,0,0,.9), 0 0 0 1px rgba(0,0,0,.4);
  animation: rise .28s var(--ease);
}
.modal-sm { width: min(440px, 100%); }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 24px 26px 6px; }
.modal-head h3 { font-family: var(--serif); font-weight: 400; font-size: 28px; margin: 0; line-height: 1.1; }
.modal-head p { margin: 6px 0 0; color: var(--muted); font-size: 13px; }
.modal-body { padding: 18px 26px 6px; overflow-y: auto; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 18px 26px 22px; }
@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(10px) scale(.985); } }

/* ---------- toast ---------- */
#toasts { position: fixed; right: 22px; bottom: 22px; z-index: 80; display: flex; flex-direction: column; gap: 10px; pointer-events: none; }
.toast {
  pointer-events: auto;
  display: flex; align-items: center; gap: 10px;
  min-width: 260px; max-width: 420px;
  padding: 12px 16px; border-radius: 12px;
  background: #18181d; border: 1px solid var(--line-2);
  box-shadow: 0 20px 50px -15px rgba(0,0,0,.8);
  font-size: 13px;
  animation: rise .25s var(--ease);
}
.toast .ico { width: 16px; height: 16px; }
.toast.ok .ico { color: var(--ok); }
.toast.err .ico { color: var(--err); }
.toast.out { opacity: 0; transform: translateY(6px); transition: all .25s; }

/* ---------- login ---------- */
.login { position: relative; z-index: 1; height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-card { width: min(400px, 100%); padding: 40px 36px 32px; text-align: center; }
.login-card .brandmark-logo { width: 52px; height: 52px; border-radius: 15px; margin: 0 auto 22px; }
.login-card .brandmark-logo svg { width: 24px; height: 24px; }
.login-card .display { font-size: 36px; }
.login-card form { margin-top: 28px; display: flex; flex-direction: column; gap: 12px; text-align: left; }
.login-err { color: var(--err); font-size: 12.5px; min-height: 18px; }

/* ==========================================================================
   Chat
   ========================================================================== */
.chat { display: grid; grid-template-columns: 300px 1fr; height: 100%; min-height: 0; }
.conv-pane { display: flex; flex-direction: column; min-height: 0; border-right: 1px solid var(--line); background: rgba(13, 13, 16, .6); }
.conv-head { padding: 22px 16px 12px; display: flex; flex-direction: column; gap: 14px; }
.pane-title { font-family: var(--serif); font-weight: 400; font-size: 26px; margin: 0; line-height: 1; }
.conv-list { flex: 1; overflow-y: auto; padding: 4px 10px 16px; }
.conv-group { font-size: 10.5px; letter-spacing: .16em; text-transform: uppercase; color: var(--faint); padding: 14px 8px 6px; }
.conv-item {
  display: flex; gap: 11px; align-items: flex-start;
  padding: 10px; border-radius: 11px;
  border: 1px solid transparent;
  transition: background .2s, border-color .2s;
}
.conv-item:hover { background: rgba(255,255,255,.03); }
.conv-item.active { background: var(--panel-2); border-color: var(--line-2); }
.ci-main { flex: 1; min-width: 0; }
.ci-title { font-size: 13px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: flex; align-items: center; gap: 6px; }
.ci-title .ico { width: 12px; height: 12px; color: var(--gold); }
.ci-sub { font-size: 11.5px; color: var(--faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
.ci-time { font-size: 10.5px; color: var(--faint); white-space: nowrap; padding-top: 2px; }
.conv-empty { padding: 30px 14px; text-align: center; color: var(--faint); font-size: 12.5px; }

.thread { display: flex; flex-direction: column; min-width: 0; min-height: 0; position: relative; }
.thread-head {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 24px; min-height: 68px;
  border-bottom: 1px solid var(--line);
  background: rgba(8,8,10,.6);
  backdrop-filter: blur(12px);
}
.th-meta { min-width: 0; flex: 1; }
.th-name { font-weight: 600; font-size: 14.5px; display: flex; align-items: baseline; gap: 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.th-role { color: var(--muted); font-weight: 400; font-size: 12.5px; }
.th-sub { display: flex; align-items: center; gap: 8px; margin-top: 3px; font-size: 12px; color: var(--muted); }
.th-sub .sep { color: var(--faint); }
.th-actions { display: flex; align-items: center; gap: 6px; }
.back-btn { display: none; }

.messages { flex: 1; overflow-y: auto; scroll-behavior: auto; }
.messages-inner { max-width: 820px; margin: 0 auto; padding: 32px 28px 24px; display: flex; flex-direction: column; gap: 26px; }

.msg { display: flex; gap: 14px; animation: msgIn .3s var(--ease); }
@keyframes msgIn { from { opacity: 0; transform: translateY(4px); } }
.msg-body { min-width: 0; flex: 1; }
.msg-user { justify-content: flex-end; }
.msg-user .msg-body { flex: 0 1 auto; max-width: 78%; display: flex; flex-direction: column; align-items: flex-end; }
.msg-user .msg-content {
  background: linear-gradient(180deg, rgba(214,182,124,.11), rgba(214,182,124,.06));
  border: 1px solid rgba(214,182,124,.18);
  padding: 11px 15px; border-radius: 16px 16px 4px 16px;
  color: #f4ecdc; white-space: pre-wrap; word-wrap: break-word;
}
.msg-ai .msg-avatar { padding-top: 2px; }
.msg-name { font-size: 12.5px; font-weight: 600; margin-bottom: 6px; display: flex; gap: 8px; align-items: baseline; }
.msg-name span { color: var(--faint); font-weight: 400; font-size: 11.5px; }
.msg-meta { display: flex; align-items: center; gap: 8px; margin-top: 8px; font-size: 11px; color: var(--faint); opacity: 0; transition: opacity .2s; font-variant-numeric: tabular-nums; }
.msg:hover .msg-meta, .msg-meta.show { opacity: 1; }
.msg-meta button { border: 0; background: none; color: var(--faint); padding: 0; font-size: 11px; display: inline-flex; align-items: center; gap: 4px; }
.msg-meta button:hover { color: var(--gold-hi); }
.msg-meta .ico { width: 12px; height: 12px; }
.msg-error { margin-top: 10px; display: flex; gap: 10px; align-items: flex-start; padding: 11px 14px; border-radius: 11px; background: rgba(239,122,114,.07); border: 1px solid rgba(239,122,114,.2); color: #f5b0aa; font-size: 13px; }
.msg-error .ico { color: var(--err); width: 16px; height: 16px; margin-top: 1px; }
.msg-note { margin-top: 8px; font-size: 11.5px; color: var(--warn); }

.tools { display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; padding: 10px 12px; border-radius: 11px; background: rgba(255,255,255,.02); border: 1px solid var(--line); }
.tools summary { cursor: pointer; font-size: 12px; color: var(--muted); list-style: none; display: flex; align-items: center; gap: 8px; }
.tools summary::-webkit-details-marker { display: none; }
.tools summary .ico { width: 14px; height: 14px; color: var(--gold); }
.tool-row { display: flex; gap: 8px; font-size: 12px; color: var(--muted); padding-left: 22px; min-width: 0; }
.tool-row b { color: var(--text-2); font-weight: 500; white-space: nowrap; }
.tool-row span { font-family: var(--mono); font-size: 11.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--faint); }
.tools[open] summary { margin-bottom: 6px; }

.typing { display: inline-flex; gap: 4px; padding: 8px 0; }
.typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--gold); opacity: .3; animation: blink 1.2s infinite; }
.typing i:nth-child(2) { animation-delay: .15s; }
.typing i:nth-child(3) { animation-delay: .3s; }
@keyframes blink { 30% { opacity: 1; transform: translateY(-2px); } }
.caret::after { content: ''; display: inline-block; width: 7px; height: 15px; margin-left: 2px; vertical-align: -2px; background: var(--gold); border-radius: 1px; animation: caret 1s steps(2) infinite; }
@keyframes caret { 50% { opacity: 0; } }

/* prose (markdown) */
.prose { color: var(--text); font-size: 14.5px; line-height: 1.7; word-wrap: break-word; }
.prose > :first-child { margin-top: 0; }
.prose > :last-child { margin-bottom: 0; }
.prose p { margin: 0 0 12px; }
.prose h1, .prose h2, .prose h3, .prose h4 { margin: 22px 0 10px; line-height: 1.3; font-weight: 600; letter-spacing: -.1px; }
.prose h1 { font-size: 20px; } .prose h2 { font-size: 17.5px; } .prose h3 { font-size: 15.5px; } .prose h4 { font-size: 14.5px; color: var(--text-2); }
.prose ul, .prose ol { margin: 0 0 12px; padding-left: 22px; }
.prose li { margin: 4px 0; }
.prose li::marker { color: var(--gold-lo); }
.prose strong { color: #fff; font-weight: 600; }
.prose a { color: var(--gold-hi); text-decoration: underline; text-decoration-color: var(--gold-line); text-underline-offset: 3px; }
.prose code { font-family: var(--mono); font-size: 12.5px; padding: 2px 6px; border-radius: 6px; background: rgba(255,255,255,.06); border: 1px solid var(--line); color: #f1dfbd; }
.prose blockquote { margin: 0 0 12px; padding: 4px 0 4px 16px; border-left: 2px solid var(--gold-line); color: var(--text-2); }
.prose hr { border: 0; height: 1px; background: var(--line-2); margin: 20px 0; }
.prose table { width: 100%; border-collapse: collapse; margin: 4px 0 14px; font-size: 13px; display: block; overflow-x: auto; }
.prose th, .prose td { text-align: left; padding: 8px 12px; border-bottom: 1px solid var(--line); }
.prose th { color: var(--muted); font-weight: 500; font-size: 12px; border-bottom-color: var(--line-2); }
.code { margin: 4px 0 14px; border-radius: 12px; background: #0a0a0d; border: 1px solid var(--line-2); overflow: hidden; }
.code-head { display: flex; justify-content: space-between; align-items: center; padding: 7px 12px 7px 14px; border-bottom: 1px solid var(--line); font-size: 11px; color: var(--faint); font-family: var(--mono); }
.code-head button { border: 0; background: none; color: var(--muted); font-size: 11px; padding: 2px 6px; border-radius: 6px; }
.code-head button:hover { color: var(--gold-hi); background: rgba(255,255,255,.05); }
.code code { display: block; padding: 14px 16px; overflow-x: auto; font-family: var(--mono); font-size: 12.5px; line-height: 1.65; color: #e3e3e8; background: none; border: 0; white-space: pre; }

/* composer */
.composer { padding: 6px 28px 22px; }
.composer-box {
  max-width: 820px; margin: 0 auto;
  background: linear-gradient(180deg, rgba(255,255,255,.025), transparent), var(--panel);
  border: 1px solid var(--line-2);
  border-radius: 18px;
  padding: 12px 12px 10px 16px;
  box-shadow: 0 20px 50px -25px rgba(0,0,0,.9);
  transition: border-color .2s, box-shadow .2s;
}
.composer-box:focus-within { border-color: var(--gold-line); box-shadow: 0 0 0 4px rgba(214,182,124,.06), 0 20px 50px -25px rgba(0,0,0,.9); }
.composer textarea { width: 100%; border: 0; outline: none; background: transparent; resize: none; min-height: 24px; max-height: 240px; line-height: 1.55; font-size: 14.5px; padding: 2px 0; }
.composer textarea::placeholder { color: var(--faint); }
.composer.drag .composer-box { border-color: var(--gold); border-style: dashed; background: rgba(214,182,124,.04); }
.msg-files { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.msg-user .msg-files { justify-content: flex-end; }
.msg-img { display: block; border-radius: 12px; overflow: hidden; border: 1px solid var(--line-2); background: var(--bg-2); max-width: min(320px, 100%); }
.msg-img img { display: block; max-width: 100%; max-height: 260px; object-fit: contain; }
.msg-file { display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 10px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--panel-2); min-width: 220px; max-width: 100%; }
.msg-file-ext { flex-shrink: 0; width: 38px; height: 38px; border-radius: 9px; display: grid; place-items: center; font-size: 10.5px; font-weight: 700; letter-spacing: .4px; color: #1d1508; background: var(--gold-grad); }
.msg-file-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; color: var(--text); text-decoration: none; }
.msg-file-name:hover { color: var(--gold-hi); }
.composer-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 8px; }
.composer-hint { font-size: 11px; color: var(--faint); display: flex; align-items: center; gap: 10px; }
.kbd { font-family: var(--mono); font-size: 10.5px; padding: 1px 5px; border-radius: 5px; border: 1px solid var(--line-2); color: var(--muted); }
.send-btn {
  width: 36px; height: 36px; border-radius: 11px; border: 0;
  display: grid; place-items: center;
  background: var(--gold-grad); color: #1d1508;
  box-shadow: 0 8px 20px -8px rgba(214,182,124,.7), inset 0 1px 0 rgba(255,255,255,.45);
  transition: transform .15s, opacity .2s, filter .2s;
}
.send-btn:hover { filter: brightness(1.07); }
.send-btn:active { transform: scale(.94); }
.send-btn:disabled { opacity: .35; pointer-events: none; }
.send-btn .ico { width: 17px; height: 17px; stroke-width: 2.2; }
.send-btn.stop { background: var(--panel-3); color: var(--text); box-shadow: inset 0 0 0 1px var(--line-3); }

/* intro & start */
.intro { text-align: center; padding: 60px 20px 20px; }
.intro .avatar { margin: 0 auto 18px; }
.intro h2 { font-family: var(--serif); font-weight: 400; font-size: 32px; margin: 0; }
.intro p { color: var(--muted); margin: 8px auto 0; max-width: 460px; }
.suggests { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 24px; }
.suggest { border: 1px solid var(--line-2); background: rgba(255,255,255,.02); border-radius: 999px; padding: 8px 14px; font-size: 12.5px; color: var(--text-2); transition: all .2s; }
.suggest:hover { border-color: var(--gold-line); color: var(--gold-hi); background: var(--gold-soft); }

.start { flex: 1; overflow-y: auto; }
.start-inner { max-width: 860px; margin: 0 auto; padding: 56px 28px 40px; }
.start-label { font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--faint); margin: 34px 0 12px; display: flex; justify-content: space-between; align-items: center; }
.pick-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.pick {
  text-align: left; display: flex; gap: 12px; align-items: center;
  padding: 14px; border-radius: 14px;
  background: var(--panel); border: 1px solid var(--line);
  transition: all .2s;
}
.pick:hover { border-color: var(--line-2); background: var(--panel-2); }
.pick.on { border-color: var(--gold-line); background: linear-gradient(180deg, rgba(214,182,124,.08), rgba(214,182,124,.02)); box-shadow: 0 0 0 3px rgba(214,182,124,.06); }
.pick-name { font-weight: 600; font-size: 13.5px; }
.pick-role { font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pick > div { min-width: 0; }
.start-row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.start-row .select { width: auto; min-width: 240px; }
.start .composer { padding: 26px 0 0; }
.notice {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 14px 16px; border-radius: 13px; margin-top: 24px;
  background: rgba(233,187,98,.06); border: 1px solid rgba(233,187,98,.2); color: #f0d6a4; font-size: 13px;
}
.notice .ico { color: var(--warn); margin-top: 1px; }
.notice a { color: var(--gold-hi); text-decoration: underline; text-underline-offset: 3px; }

/* ==========================================================================
   Token
   ========================================================================== */
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.kpi { padding: 20px 22px; }
.kpi-label { font-size: 11.5px; color: var(--muted); display: flex; align-items: center; gap: 8px; letter-spacing: .02em; }
.kpi-label .ico { width: 15px; height: 15px; color: var(--gold); }
.kpi-value { font-family: var(--serif); font-size: 38px; line-height: 1; margin-top: 14px; font-variant-numeric: tabular-nums; letter-spacing: -.5px; }
.kpi-sub { font-size: 12px; color: var(--faint); margin-top: 8px; font-variant-numeric: tabular-nums; }
.kpi-hero { background: radial-gradient(400px 160px at 0% 0%, rgba(214,182,124,.12), transparent 70%), linear-gradient(180deg, rgba(255,255,255,.02), transparent), var(--panel); border-color: var(--gold-line); }
.kpi-hero .kpi-value { background: var(--gold-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }

.budget { display: flex; align-items: center; gap: 24px; }
.budget-bar { flex: 1; }
.budget-bar .meter { height: 8px; margin-top: 0; }
.budget-legend { display: flex; justify-content: space-between; margin-top: 10px; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }

.chart-wrap { position: relative; padding: 8px 24px 20px; }
.chart { width: 100%; height: 240px; display: block; overflow: visible; }
.chart .grid line { stroke: rgba(255,255,255,.05); }
.chart .axis text { fill: var(--faint); font-size: 10.5px; font-family: var(--font); }
.chart .bar { transition: opacity .2s; }
.chart .col:hover .bar { opacity: 1; filter: brightness(1.15); }
.chart .col .hit { fill: transparent; }
.chart .col:hover .hit { fill: rgba(255,255,255,.025); }
.chart-tip {
  position: absolute; pointer-events: none; z-index: 2;
  padding: 10px 12px; border-radius: 10px; min-width: 160px;
  background: #1a1a1f; border: 1px solid var(--line-2); box-shadow: 0 16px 40px -12px rgba(0,0,0,.8);
  font-size: 12px; opacity: 0; transform: translate(-50%, -8px); transition: opacity .15s;
}
.chart-tip.show { opacity: 1; }
.chart-tip b { display: block; margin-bottom: 6px; font-weight: 600; }
.chart-tip div { display: flex; justify-content: space-between; gap: 16px; color: var(--muted); font-variant-numeric: tabular-nums; }
.chart-tip div span:last-child { color: var(--text); }
.legend { display: flex; gap: 16px; font-size: 12px; color: var(--muted); }
.legend i { display: inline-block; width: 9px; height: 9px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }

.breakdown { display: flex; flex-direction: column; gap: 14px; }
.bd-row { display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; align-items: center; }
.bd-name { display: flex; align-items: center; gap: 10px; font-size: 13px; min-width: 0; }
.bd-name span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bd-val { font-size: 12.5px; font-variant-numeric: tabular-nums; text-align: right; }
.bd-val small { color: var(--faint); margin-left: 6px; }
.bd-bar { grid-column: 1 / -1; height: 4px; border-radius: 4px; background: rgba(255,255,255,.05); overflow: hidden; }
.bd-bar i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--tone-b, var(--gold-lo)), var(--tone-a, var(--gold-hi))); }

.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th { text-align: left; font-weight: 500; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); padding: 12px 16px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 12px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background .15s; }
.table tbody tr:hover { background: rgba(255,255,255,.015); }
.table .r { text-align: right; font-variant-numeric: tabular-nums; }
.table-wrap { overflow-x: auto; }
.cell-agent { display: flex; align-items: center; gap: 10px; }
.cell-title { max-width: 240px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); }

.price-grid { display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 10px 14px; align-items: center; }
.price-grid .h { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); }

/* ==========================================================================
   Akun
   ========================================================================== */
.acct { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: start; }
.acct .span-2 { grid-column: 1 / -1; }
.status-line { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: 12px; background: var(--bg-2); border: 1px solid var(--line); }
.status-line .ico { color: var(--gold); }
.status-line b { font-weight: 600; font-size: 13px; }
.status-line .sub { font-size: 12px; color: var(--muted); }
.status-line .grow { flex: 1; min-width: 0; }
.engine-opts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.engine-opt { text-align: left; padding: 14px; border-radius: 13px; border: 1px solid var(--line); background: var(--bg-2); transition: all .2s; }
.engine-opt:hover { border-color: var(--line-2); }
.engine-opt.on { border-color: var(--gold-line); background: linear-gradient(180deg, rgba(214,182,124,.08), rgba(214,182,124,.02)); }
.engine-opt b { display: block; font-size: 13px; font-weight: 600; margin-bottom: 4px; }
.engine-opt span { font-size: 11.5px; color: var(--muted); line-height: 1.45; display: block; }
.int-list { display: flex; flex-direction: column; gap: 8px; }
.int-item { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 12px; background: var(--bg-2); border: 1px solid var(--line); }
.int-logo { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--panel-3); color: var(--text-2); font-weight: 700; font-size: 12px; }
.int-item .grow { flex: 1; min-width: 0; }
.int-item b { font-size: 13px; font-weight: 600; }
.int-item .sub { font-size: 11.5px; color: var(--muted); font-family: var(--mono); }

/* skeleton */
.sk { background: linear-gradient(90deg, rgba(255,255,255,.03), rgba(255,255,255,.07), rgba(255,255,255,.03)); background-size: 200% 100%; animation: sk 1.4s infinite; border-radius: 8px; }
@keyframes sk { to { background-position: -200% 0; } }

/* ==========================================================================
   Ruang brand
   ========================================================================== */
a.tile-name { display: block; position: relative; }
a.tile-name:hover { color: var(--gold-hi); }
.room-head { position: relative; display: flex; align-items: center; gap: 18px; margin-bottom: 26px; flex-wrap: wrap; }
.room-head::before { content: ''; position: absolute; inset: -40px -44px auto; height: 200px; pointer-events: none; z-index: -1;
  background: radial-gradient(500px 160px at 10% 0%, color-mix(in srgb, var(--tone-b) 22%, transparent), transparent 70%); }
.room-head .brand-mono { width: 64px; height: 64px; border-radius: 20px; font-size: 32px; }
.room-title { flex: 1; min-width: 240px; }
.room-meta { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 10px; font-size: 13px; color: var(--muted); align-items: center; }
.room-meta a { display: inline-flex; align-items: center; gap: 6px; }
.room-meta a:hover { color: var(--gold-hi); }
.room-tabs { display: flex; gap: 6px; padding: 5px; margin-bottom: 22px; border-radius: 999px; width: fit-content; max-width: 100%; overflow-x: auto;
  background: var(--bg-2); border: 1px solid var(--line-2); }
.room-tabs a { padding: 8px 18px; border-radius: 999px; color: var(--muted); font-weight: 500; font-size: 13.5px; white-space: nowrap; border: 1px solid transparent; transition: all .2s; }
.room-tabs a:hover { color: var(--text); }
.room-tabs a.on { color: var(--gold-hi); border-color: var(--gold-line); background: linear-gradient(180deg, rgba(214,182,124,.12), rgba(214,182,124,.03)); }
.room-tabs em { font-style: normal; color: var(--faint); }
.room-tabs a.on em { color: var(--gold); }
.dot-ok { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--ok); vertical-align: 1px; }

/* berkas */
.crumbs { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; margin-bottom: 12px; font-size: 13px; }
.crumbs button { border: 0; background: none; color: var(--muted); padding: 4px 8px; border-radius: 7px; display: inline-flex; align-items: center; gap: 6px; }
.crumbs button:hover { color: var(--text); background: rgba(255,255,255,.04); }
.crumbs button:last-child { color: var(--text); font-weight: 500; }
.crumbs span { color: var(--faint); }
.file-table td { padding-top: 9px; padding-bottom: 9px; }
.file-row { cursor: pointer; }
.file-name { display: inline-flex; align-items: center; gap: 10px; border: 0; background: none; padding: 0; text-align: left; color: var(--text); max-width: 460px; }
.file-name span, .file-name b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.file-name .ico { color: var(--gold); width: 16px; height: 16px; }
button.file-name:hover span { color: var(--gold-hi); }
.dropzone { position: relative; border-radius: 14px; min-height: 160px; }
.drop-overlay { position: absolute; inset: 0; display: none; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  border: 2px dashed var(--gold-line); border-radius: 14px; background: rgba(12,11,9,.88); color: var(--gold-hi); z-index: 2; }
.dropzone.over .drop-overlay { display: flex; }
.drop-empty { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; padding: 48px 20px; border: 1px dashed var(--line-2); border-radius: 14px; }
.drop-empty .faint { font-size: 12.5px; max-width: 420px; }
.upload-bar { padding: 12px 14px; border-radius: 12px; background: var(--bg-2); border: 1px solid var(--gold-line); margin-bottom: 12px; font-size: 12.5px; }
.upload-bar .meter { margin-top: 8px; }
.modal-wide { width: min(980px, 100%); }
.preview-img { max-width: 100%; max-height: 70vh; display: block; margin: 0 auto; border-radius: 10px; }
.code-edit { min-height: 56vh; font-size: 12.5px; line-height: 1.6; white-space: pre; tab-size: 2; }

/* laporan */
.reports { display: flex; flex-direction: column; gap: 12px; }
.report { display: flex; gap: 14px; padding: 18px 20px; border-radius: var(--r-lg); background: var(--panel); border: 1px solid var(--line); }
.report-body { flex: 1; min-width: 0; }
.report-top { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; font-size: 13px; }
.report-cost { margin-left: auto; font-size: 12px; }
.report-title { font-weight: 600; margin-top: 6px; }
.report-summary { color: var(--text-2); font-size: 13px; margin: 6px 0 10px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
a.chip:hover { color: var(--gold-hi); border-color: var(--gold-line); }

/* tugas */
.kanban { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; align-items: start; }
.kanban-col { background: rgba(255,255,255,.015); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 12px; display: flex; flex-direction: column; gap: 10px; min-height: 200px; }
.kanban-head { display: flex; justify-content: space-between; padding: 4px 6px 6px; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.kanban-head em { font-style: normal; color: var(--faint); }
.kanban-empty { color: var(--faint); font-size: 12.5px; text-align: center; padding: 24px 0; }
.task { padding: 14px; border-radius: 13px; background: var(--panel-2); border: 1px solid var(--line); cursor: grab; transition: border-color .2s; }
.task:hover { border-color: var(--line-3); }
.task-title { font-weight: 600; margin-top: 10px; font-size: 13.5px; }
.task-desc { color: var(--muted); font-size: 12.5px; margin: 6px 0 0; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; white-space: pre-wrap; }
.task-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 12px; }

/* koneksi */
.cf-logo { width: 26px; height: 26px; border-radius: 8px; display: inline-grid; place-items: center; font-size: 10.5px; font-weight: 800; color: #2b1300; background: linear-gradient(140deg, #ffc27a, #f38020); }
.res-list { display: flex; flex-direction: column; gap: 8px; }
.res-item { display: flex; justify-content: space-between; gap: 12px; font-size: 12.5px; padding: 8px 10px; border-radius: 9px; background: var(--bg-2); border: 1px solid var(--line); }
.res-item b { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.res-item span { white-space: nowrap; }

/* ingatan & aktivitas */
.mem-list { display: flex; flex-direction: column; gap: 8px; }
.mem-item { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: 11px; background: var(--bg-2); border: 1px solid var(--line); font-size: 13px; }
.mem-item .grow { flex: 1; min-width: 0; }
.danger-zone { border-color: rgba(239,122,114,.2); }
.danger-zone .card-body { padding: 0 0 6px; }
.act-row { display: flex; gap: 10px; align-items: flex-start; padding: 8px 0; border-bottom: 1px solid var(--line); }
.act-row:last-child { border-bottom: 0; }
.act-row .grow { flex: 1; min-width: 0; }
.act-title { font-size: 13px; }
.act-title a { color: var(--muted); }
.act-title a:hover { color: var(--gold-hi); }
.act-sub { font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.act-time { font-size: 11.5px; text-align: right; white-space: nowrap; }
.act-scroll { max-height: 280px; overflow-y: auto; }
.live-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--ok); margin-right: 6px; box-shadow: 0 0 0 0 rgba(111,211,165,.6); animation: pulse 1.6s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 7px rgba(111,211,165,0); } 100% { box-shadow: 0 0 0 0 rgba(111,211,165,0); } }
.attach-list { display: flex; flex-wrap: wrap; gap: 6px; }
.attach-list:not(:empty) { margin-bottom: 8px; }
.composer-hint .icon-btn { width: 30px; height: 30px; }
.seg button:disabled { opacity: .35; cursor: not-allowed; }

/* ==========================================================================
   Akun terhubung (AI & Cloudflare)
   ========================================================================== */
.engine-banner { display: flex; align-items: center; gap: 16px; padding: 18px 20px; margin-bottom: 26px; }
.engine-banner.ok { border-color: rgba(111,211,165,.28); background: linear-gradient(90deg, rgba(111,211,165,.08), transparent 60%), var(--panel); }
.engine-banner.bad { border-color: rgba(239,122,114,.28); background: linear-gradient(90deg, rgba(239,122,114,.08), transparent 60%), var(--panel); }
.engine-banner .grow { flex: 1; min-width: 0; }
.engine-banner b { font-size: 16px; }
.engine-ico { width: 52px; height: 52px; border-radius: 15px; display: grid; place-items: center; flex-shrink: 0; }
.engine-banner.ok .engine-ico { background: rgba(111,211,165,.12); color: var(--ok); border: 1px solid rgba(111,211,165,.3); }
.engine-banner.bad .engine-ico { background: rgba(239,122,114,.12); color: var(--err); border: 1px solid rgba(239,122,114,.3); }
.section-label { display: flex; align-items: center; gap: 10px; margin: 0 0 14px; font-size: 12px; letter-spacing: .16em; text-transform: uppercase; color: var(--gold); font-weight: 600; }
.section-label em { font-style: normal; font-size: 11px; color: var(--muted); padding: 1px 8px; border-radius: 999px; background: rgba(255,255,255,.06); letter-spacing: 0; }
.section-label i { flex: 1; height: 1px; background: var(--line-2); }
.acc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 16px; }
.acc-card { display: flex; flex-direction: column; gap: 10px; padding: 18px; border-radius: var(--r-lg); text-align: left;
  background: linear-gradient(160deg, rgba(111,211,165,.05), transparent 45%), var(--panel); border: 1px solid var(--line-2); box-shadow: var(--shadow); }
.acc-top { display: flex; gap: 12px; align-items: flex-start; }
.acc-logo { position: relative; width: 46px; height: 46px; border-radius: 13px; display: grid; place-items: center; flex-shrink: 0; color: #fff; }
.acc-logo.ai { background: linear-gradient(140deg, #e8875f, #b8502e); }
.acc-logo.cf { background: linear-gradient(140deg, #ffb35c, #f38020); }
.acc-logo .ico { width: 22px; height: 22px; }
.acc-logo i { position: absolute; right: -3px; bottom: -3px; width: 13px; height: 13px; border-radius: 50%; border: 2px solid var(--panel); background: var(--faint); }
.acc-logo i.on { background: var(--ok); }
.acc-logo i.off { background: var(--err); }
.acc-name { font-weight: 600; font-size: 14.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acc-sub { font-size: 12.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.acc-brands { min-height: 26px; }
.acc-limits { display: flex; flex-direction: column; gap: 9px; padding: 11px 12px; border-radius: 11px; background: var(--bg-2); border: 1px solid var(--line); }
.lim-row { display: flex; justify-content: space-between; gap: 8px; font-size: 12.5px; color: var(--text-2); }
.lim-row b { font-variant-numeric: tabular-nums; font-weight: 600; }
.lim-bar { height: 5px; border-radius: 3px; background: var(--panel-3); overflow: hidden; margin-top: 5px; }
.lim-bar span { display: block; height: 100%; border-radius: 3px; background: var(--info); transition: width .4s; }
.lim-bar span.warn { background: var(--warn); }
.lim-bar span.full { background: var(--err); }
.lim-reset { font-size: 11px; color: var(--faint); margin-top: 3px; }
.lim-foot { display: flex; justify-content: space-between; align-items: center; font-size: 11px; color: var(--faint); }
.acc-actions { display: flex; gap: 6px; margin-top: auto; padding-top: 4px; }
.acc-actions .btn { flex: 1; }
.acc-new { align-items: center; justify-content: center; min-height: 200px; border-style: dashed; background: transparent; box-shadow: none; color: var(--muted); cursor: pointer; transition: all .2s; }
.acc-new:hover { color: var(--gold-hi); border-color: var(--gold-line); background: rgba(214,182,124,.03); }
.acc-plus { width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; border: 1px solid var(--line-3); }
.step { display: flex; gap: 14px; align-items: flex-start; padding: 14px; border-radius: 13px; background: var(--bg-2); border: 1px solid var(--line); }
.step .grow { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.step-n { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; flex-shrink: 0; font-size: 12px; font-weight: 700; color: #1d1508; background: var(--gold-grad); }
.step-p { font-size: 12.5px; margin: 4px 0 10px; }
.step .btn { align-self: flex-start; }
.acc-logo i.wait { background: var(--warn); }
.link-btn { border: 0; background: none; padding: 0; color: var(--muted); font-size: 12px; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; align-self: flex-start; }
.link-btn:hover { color: var(--gold-hi); }
.span-all { grid-column: 1 / -1; }
.akun-baru { display: flex; flex-direction: column; gap: 12px; padding: 20px; border-color: var(--gold-line); }
.type-seg { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.type-seg button { height: 40px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--bg-2); color: var(--text-2); font-weight: 600; font-size: 13px; transition: all .2s; }
.type-seg button:hover { border-color: var(--line-3); }
.type-seg button.on { color: var(--gold-hi); border-color: var(--gold); background: linear-gradient(180deg, rgba(214,182,124,.14), rgba(214,182,124,.04)); }
.setup-card { border-color: var(--gold-line); margin-bottom: 4px; }
.acc-card .login-box { margin-top: 2px; }
.login-box { margin-top: 4px; padding: 16px; border-radius: 14px; border: 1px solid var(--gold-line); background: linear-gradient(180deg, rgba(214,182,124,.06), transparent); display: flex; flex-direction: column; gap: 16px; }
.login-step { display: flex; flex-direction: column; gap: 8px; }
.login-step > b { font-size: 13.5px; }
.claude-row { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; background: var(--bg-2); border: 1px solid var(--line); font-size: 12.5px; }
.claude-row .grow { flex: 1; min-width: 0; }
.claude-row b { font-weight: 500; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dot-err { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--err); flex-shrink: 0; }
.claude-row .dot-ok { flex-shrink: 0; }
.acc-logo.laptop { background: linear-gradient(140deg, #9fb3d9, #4b5d86); }
.cmd { display: flex; align-items: center; gap: 8px; margin-top: 6px; padding: 6px 6px 6px 12px; border-radius: 10px; background: #0a0a0d; border: 1px solid var(--line-2); }
.cmd code { flex: 1; min-width: 0; font-family: var(--mono); font-size: 12px; color: #f1dfbd; overflow-x: auto; white-space: nowrap; }
.cmd .icon-btn { width: 28px; height: 28px; flex-shrink: 0; }
.radio-row { display: flex; gap: 10px; align-items: center; font-size: 13px; cursor: pointer; }
.radio-row input { accent-color: var(--gold); }

/* ---------- responsive ---------- */
@media (max-width: 1180px) {
  .kpis { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 1060px) {
  :root { --side-w: 76px; }
  .side { padding: 20px 12px 14px; align-items: center; }
  .brandmark { padding: 4px 0 22px; }
  .brandmark-text, .nav-label, .nav a span, .nav-count, .meter-card, .me-text, .me-logout { display: none; }
  .nav a { justify-content: center; padding: 11px; }
  .nav a.active::before { left: -12px; }
  .me { justify-content: center; }
  .acct { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .chat { grid-template-columns: 1fr; }
  .chat.has-thread .conv-pane { display: none; }
  .chat:not(.has-thread) .thread { display: none; }
  .back-btn { display: inline-grid; }
  .page-inner { padding: 28px 20px 60px; }
  .display { font-size: 34px; }
  .page-head { flex-direction: column; align-items: flex-start; }
  .grid-2, .grid-3, .engine-opts, .kanban { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .shell { grid-template-columns: 1fr; grid-template-rows: 1fr auto; }
  .side { order: 2; flex-direction: row; padding: 6px 10px; border-right: 0; border-top: 1px solid var(--line); justify-content: space-around; }
  .brandmark, .side-foot { display: none; }
  .nav { flex-direction: row; gap: 4px; width: 100%; justify-content: space-around; }
  .nav a.active::before { display: none; }
  .kpis { grid-template-columns: 1fr; }
  .messages-inner { padding: 24px 16px; }
  .composer { padding: 6px 12px 12px; }
  .msg-user .msg-body { max-width: 90%; }
}

/* Tombol hapus lampiran di composer */
.chip-x {
  display: inline-grid; place-items: center;
  width: 16px; height: 16px; margin: 0 -4px 0 2px; padding: 0;
  border: 0; border-radius: 50%; background: transparent;
  color: inherit; font-size: 14px; line-height: 1; cursor: pointer; opacity: .7;
}
.chip-x:hover { opacity: 1; background: rgba(255,255,255,.12); }
.chip-prev {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 0; border: 0; background: none; color: inherit; font: inherit; cursor: zoom-in;
}
.chip-prev:hover { text-decoration: underline; }
