@font-face {
  font-family: 'Montserrat';
  src: url('../fonts/montserrat-latin.woff2') format('woff2');
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --navy: #142f43;
  --navy-deep: #0f2537;
  --navy-mid: #3d5670;
  --pink: #b8336a;
  --pink-dark: #9c2858;
  --pink-soft: #fdd9f7;
  --pink-wash: #fff4fa;
  --pink-line: #f3c6dd;
  --blue-soft: #c1d5f6;
  --ground: #e6e9ef;
  --card: #ffffff;
  --tile: #f7f8fb;
  --line: #e6eaf0;
  --line-soft: #f0f2f6;
  --muted: #5b6b7a;
  --text-2: #33475b;
  --positive: #1f7a4d;
  --positive-soft: #ddf3e6;
  --negative: #b42318;
  --negative-soft: #fde4e1;
  --warn-soft: #fff1d6;
  --warn: #7a4b00;
  --radius-card: 24px;
  --radius-tile: 16px;
  --font: 'Montserrat', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--ground);
  color: var(--navy);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
}
a { color: var(--navy); }
a:hover { color: var(--pink); }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--pink); outline-offset: 2px; }
h1, h2, h3, p { margin: 0; }
#view { display: flex; flex-direction: column; gap: 28px; }
#view:focus { outline: none; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.frame {
  min-height: 100vh;
  min-height: 100dvh;
  padding: 24px clamp(16px, 3vw, 48px) 32px;
  /* --hero-end diisi JS: jarak dari atas frame ke bawah hero, agar teks hero selalu di atas latar gelap. */
  --hero-end: 330px;
  background: linear-gradient(180deg, #0f2537 0px, #1a3a55 calc(var(--hero-end) - 110px), #4c5d86 calc(var(--hero-end) + 10px), #cfc7e0 calc(var(--hero-end) + 130px), #f4f5f8 calc(var(--hero-end) + 270px));
  display: flex;
  flex-direction: column;
  gap: 28px;
}
.frame > * { width: 100%; max-width: 1760px; margin-inline: auto; }

/* Top bar */
.topbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; position: relative; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: #fff; border-radius: 14px; padding: 4px 8px 4px 4px; }
.brand:hover { color: #fff; background: rgba(255, 255, 255, 0.1); }
.brand-mark { width: 40px; height: 40px; border-radius: 12px; background: #fff; color: var(--navy); display: grid; place-items: center; font-weight: 700; font-size: 13px; letter-spacing: 0.04em; }
.brand-text { display: flex; flex-direction: column; line-height: 1.2; white-space: nowrap; }
.brand-text strong { font-weight: 600; font-size: 16px; }
.brand-text span { font-size: 12px; color: #c9d6e8; }
.nav { display: flex; flex-wrap: wrap; gap: 8px; }
.nav a {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 18px;
  border-radius: 999px; font-size: 14px; color: #fff; text-decoration: none;
  background: rgba(255, 255, 255, 0.08); border: 1px solid rgba(255, 255, 255, 0.14);
}
.nav a { transition: background-color 0.2s ease, border-color 0.2s ease, transform 0.2s ease; }
.nav a:hover { background: rgba(255, 255, 255, 0.18); color: #fff; }
.nav a:active { transform: scale(0.97); }
.nav a[aria-current='page'] { background: rgba(255, 255, 255, 0.2); border-color: rgba(255, 255, 255, 0.3); font-weight: 600; }
.nav-count { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: #ff7aa8; color: #3d0f24; font-size: 11px; font-weight: 700; display: inline-grid; place-items: center; }
.nav-count[hidden] { display: none; }
.top-actions { display: flex; align-items: center; gap: 10px; }
.demo-badge { display: inline-flex; align-items: center; white-space: nowrap; min-height: 32px; padding: 0 14px; border-radius: 999px; background: var(--pink-soft); color: #6b1e45; font-size: 12px; font-weight: 600; }
.icon-btn {
  position: relative; width: 44px; height: 44px; border-radius: 999px; border: 1px solid rgba(255, 255, 255, 0.28);
  background: transparent; color: #fff; display: grid; place-items: center;
}
.icon-btn:hover { background: rgba(255, 255, 255, 0.12); }
.icon-btn .dot { position: absolute; top: 9px; right: 10px; width: 9px; height: 9px; border-radius: 999px; background: #ff7aa8; border: 2px solid #0f2537; }
.avatar { width: 44px; height: 44px; border-radius: 999px; background: var(--blue-soft); color: var(--navy); display: grid; place-items: center; font-weight: 700; font-size: 14px; }

.popover {
  position: absolute; top: 60px; right: 0; z-index: 20; width: min(380px, calc(100vw - 32px));
  background: #fff; border-radius: 20px; padding: 16px; box-shadow: 0 18px 48px rgba(15, 37, 55, 0.25);
  display: flex; flex-direction: column; gap: 8px;
}
.popover[hidden] { display: none; }
.popover h2 { font-size: 15px; font-weight: 600; padding: 4px 4px 8px; }
.notice { display: flex; gap: 12px; padding: 12px; border-radius: 14px; background: var(--tile); text-decoration: none; }
.notice:hover { background: #eef2f8; color: var(--navy); }
.notice-icon { flex: none; width: 36px; height: 36px; border-radius: 12px; display: grid; place-items: center; }
.notice strong { display: block; font-size: 13px; font-weight: 600; }
.notice span { display: block; font-size: 12px; color: var(--muted); }

/* Hero */
.hero { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 24px; color: #fff; }
.hero-copy { display: flex; flex-direction: column; gap: 12px; max-width: 700px; }
.hero h1 { font-size: clamp(30px, 4vw, 44px); font-weight: 500; letter-spacing: -0.02em; line-height: 1.15; }
.hero p { font-size: 16px; line-height: 1.6; color: #dce5f2; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; padding-top: 4px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; background: rgba(255, 255, 255, 0.1); font-size: 12px; color: #e8eef7; }
.chip-dot { width: 8px; height: 8px; border-radius: 999px; background: #8fe3b0; }
.chip-dot.warn { background: #ffc46b; }

.seg { display: inline-flex; padding: 4px; border-radius: 999px; background: rgba(255, 255, 255, 0.1); border: 1px solid rgba(255, 255, 255, 0.2); flex-wrap: wrap; }
.seg button { min-height: 40px; padding: 0 16px; border-radius: 999px; border: none; background: transparent; color: #fff; font-size: 13px; }
.seg button:hover { background: rgba(255, 255, 255, 0.12); }
.seg button[aria-pressed='true'] { background: #fff; color: var(--navy); font-weight: 600; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 20px;
  border-radius: 999px; border: 1px solid transparent; font-size: 14px; font-weight: 600; text-decoration: none; white-space: nowrap;
}
.btn-ghost { border-color: rgba(255, 255, 255, 0.6); background: transparent; color: #fff; font-weight: 500; }
.btn-ghost:hover { background: rgba(255, 255, 255, 0.12); color: #fff; }
.btn-light { background: #fff; color: var(--navy); }
.btn-light:hover { background: var(--pink-soft); color: var(--navy); }
.btn-soft { border-color: #dce2ea; background: #f6f7fa; color: var(--navy); font-weight: 500; font-size: 13px; min-height: 40px; padding: 0 16px; }
.btn-soft:hover { background: #e4e9f1; color: var(--navy); }
.btn-pink { background: var(--pink); color: #fff; }
.btn-pink:hover { background: var(--pink-dark); color: #fff; }
.btn-navy { background: var(--navy); color: #fff; }
.btn-navy:hover { background: #24496a; color: #fff; }
.btn-white { border-color: #dce2ea; background: #fff; color: var(--navy); }
.btn-white:hover { background: #eef2f8; color: var(--navy); }

/* Layout */
.row { display: flex; flex-wrap: wrap; gap: 20px; }
.row > * { flex: 1 1 320px; min-width: 0; }
.row > .wide { flex: 1 1 520px; }
.card { background: var(--card); border-radius: var(--radius-card); padding: 24px; display: flex; flex-direction: column; gap: 16px; }
.card.translucent { background: rgba(255, 255, 255, 0.95); }
.card-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 12px; }
.card-title { display: flex; flex-direction: column; gap: 4px; }
.card-title h2 { font-size: 16px; font-weight: 600; }
.card-title .sub { font-size: 12px; color: var(--muted); }
.icon-tile { width: 44px; height: 44px; border-radius: 14px; background: #eef2f8; display: grid; place-items: center; flex: none; }
.big-number { font-size: 36px; font-weight: 500; letter-spacing: -0.02em; line-height: 1.1; }
.mid-number { font-size: 28px; font-weight: 500; letter-spacing: -0.02em; line-height: 1.1; }
.delta { font-size: 13px; font-weight: 600; }
.delta.up { color: var(--positive); }
.delta.down { color: var(--negative); }
.delta .vs { color: var(--muted); font-weight: 400; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.legend { display: flex; flex-wrap: wrap; gap: 16px; font-size: 12px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.swatch { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.note { font-size: 13px; line-height: 1.6; color: var(--text-2); padding: 14px 16px; border-radius: 14px; background: var(--tile); }
.chart { width: 100%; height: auto; display: block; overflow: visible; }
.chart [data-tip] { cursor: default; }
.chart [data-tip]:hover, .chart [data-tip]:focus { opacity: 0.85; outline: none; }

.card-dark {
  border-radius: var(--radius-card); padding: 28px; display: flex; flex-direction: column; justify-content: space-between; gap: 24px; color: #fff;
  background: radial-gradient(120% 90% at 100% 100%, #7a4a78 0%, rgba(122, 74, 120, 0) 60%), linear-gradient(160deg, #1a3a55 0%, #0f2537 100%);
}
.card-dark h2 { font-size: 24px; font-weight: 500; line-height: 1.3; letter-spacing: -0.01em; }
.card-dark p { font-size: 14px; line-height: 1.6; color: #dce5f2; }
.pill-dark { align-self: flex-start; padding: 5px 12px; border-radius: 999px; background: rgba(255, 255, 255, 0.14); font-size: 12px; font-weight: 600; }

/* Lists */
.list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.tile { display: flex; align-items: center; gap: 14px; padding: 12px 14px; border-radius: var(--radius-tile); background: var(--tile); }
.tile-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.tile-main strong { font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile-main span { font-size: 12px; color: var(--muted); }
.tile-end { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.thumb { flex: none; width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; color: var(--navy); }
.segments { display: flex; gap: 3px; }
.segments i { width: 6px; height: 18px; border-radius: 3px; background: #dce2ea; display: block; }
.source-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 16px; padding: 14px 16px; border-radius: var(--radius-tile); background: var(--tile); }
.source-row .pct { font-size: 13px; font-weight: 600; width: 44px; text-align: right; }

/* Tables */
.table-wrap { overflow-x: auto; position: relative; }
table.data { width: 100%; border-collapse: collapse; font-size: 14px; }
table.data th, table.data td { padding: 13px 12px; border-bottom: 1px solid var(--line-soft); text-align: left; vertical-align: middle; }
table.data thead th { font-size: 12px; font-weight: 500; color: var(--muted); border-bottom-color: var(--line); padding-top: 8px; padding-bottom: 8px; }
table.data tbody th { font-weight: 600; }
table.data tr:last-child th, table.data tr:last-child td { border-bottom: none; }
table.data .num { text-align: right; font-variant-numeric: tabular-nums; }
table.data .how { font-size: 12px; color: var(--muted); }
table.data .chg { font-size: 12px; margin-left: 4px; }
.chg.up { color: var(--positive); }
.chg.down { color: var(--negative); }
.row-muted td, .row-muted th { color: var(--muted); }

/* Badges */
.badge { display: inline-flex; align-items: center; padding: 2px 10px; border-radius: 999px; font-size: 11px; font-weight: 700; white-space: nowrap; }
.badge.terbukti { background: var(--positive-soft); color: #14532d; }
.badge.indikasi { background: var(--warn-soft); color: var(--warn); }
.badge.tidak, .badge.kurang { background: #eef1f5; color: var(--text-2); }
.badge.neg { background: var(--pink); color: #fff; }
.badge.soft { background: #e6ebf2; color: var(--navy); }
.badge.outline { background: #fff; border: 1px solid #dce2ea; color: var(--navy); font-weight: 500; }
.badge.tim { background: var(--positive-soft); color: #14532d; font-weight: 600; }
.badge.ai { background: #eef2f8; color: var(--navy); font-weight: 600; }

/* Attention strip */
.attention { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; padding: 18px 22px; border-radius: 20px; background: var(--pink-wash); border: 1px solid var(--pink-line); }
.attention-body { display: flex; align-items: center; gap: 14px; flex: 1 1 420px; min-width: 0; }
.attention-icon { flex: none; width: 40px; height: 40px; border-radius: 12px; background: var(--pink-soft); color: var(--pink-dark); display: grid; place-items: center; }

/* Funnel */
.funnel { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.funnel div { border-radius: 12px; padding: 12px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.funnel span { font-size: 11px; }
.funnel strong { font-size: 16px; font-weight: 600; }

/* Findings */
.findings { display: flex; flex-direction: column; gap: 10px; }
.finding { padding: 16px 18px; border-radius: var(--radius-tile); background: var(--tile); display: flex; flex-direction: column; gap: 8px; }
.finding-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.finding h3 { font-size: 15px; font-weight: 600; line-height: 1.4; }
.finding p { font-size: 13px; line-height: 1.55; color: var(--text-2); }
.finding .meta { font-size: 12px; color: var(--muted); }
.finding.dim { opacity: 0.75; }
.head-icon { width: 36px; height: 36px; border-radius: 12px; display: grid; place-items: center; }

/* Comments */
.bar { display: flex; height: 18px; border-radius: 999px; overflow: hidden; gap: 3px; }
.stat-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.stat { padding: 14px; border-radius: var(--radius-tile); background: var(--tile); display: flex; flex-direction: column; gap: 4px; }
.stat strong { font-size: 24px; font-weight: 500; }
.topic-bar { height: 10px; border-radius: 999px; background: #eef1f5; display: flex; }
.topic-bar i { display: block; border-radius: 999px; background: var(--navy); min-width: 10px; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; }
.filters button { min-height: 44px; padding: 0 16px; border-radius: 999px; border: 1px solid #dce2ea; background: #f6f7fa; font-size: 13px; }
.filters button:hover { background: #e4e9f1; }
.filters button[aria-pressed='true'] { background: var(--navy); border-color: var(--navy); color: #fff; font-weight: 600; }
.comment { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; padding: 16px 18px; border-radius: 18px; background: var(--tile); }
.comment.urgent { background: var(--pink-wash); border: 1px solid var(--pink-line); }
.comment.done { opacity: 0.6; }
.comment-avatar { flex: none; width: 44px; height: 44px; border-radius: 999px; display: grid; place-items: center; font-weight: 700; font-size: 14px; }
.comment-body { flex: 1 1 380px; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.comment-meta { display: flex; flex-wrap: wrap; gap: 8px; font-size: 12px; color: var(--muted); }
.comment-meta strong { color: var(--navy); font-size: 13px; }
.comment-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.empty { padding: 32px; text-align: center; color: var(--muted); border-radius: var(--radius-tile); background: var(--tile); }

/* Dialogs */
dialog { border: none; border-radius: 24px; padding: 0; width: min(560px, calc(100vw - 32px)); color: var(--navy); box-shadow: 0 24px 64px rgba(15, 37, 55, 0.3); }
dialog::backdrop { background: rgba(15, 37, 55, 0.55); }
.dialog-body { padding: 24px; display: flex; flex-direction: column; gap: 16px; }
.dialog-body h2 { font-size: 18px; font-weight: 600; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 13px; font-weight: 600; }
.field input, .field select { min-height: 44px; padding: 0 14px; border-radius: 12px; border: 1px solid #ccd5e0; background: #fff; }
.field .hint { font-size: 12px; color: var(--muted); }
.field-row { display: flex; flex-wrap: wrap; gap: 12px; }
.field-row .field { flex: 1 1 180px; }
.output { padding: 14px; border-radius: 12px; background: var(--tile); font-size: 13px; word-break: break-all; font-family: ui-monospace, 'Cascadia Mono', Consolas, monospace; }
.dialog-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; }

/* Tooltip & toast */
.tip { position: fixed; z-index: 50; pointer-events: none; padding: 6px 10px; border-radius: 8px; background: var(--navy-deep); color: #fff; font-size: 12px; white-space: nowrap; transform: translate(-50%, calc(-100% - 10px)); }
.tip[hidden] { display: none; }
.toast { position: fixed; z-index: 60; left: 50%; bottom: 24px; transform: translateX(-50%); padding: 12px 18px; border-radius: 999px; background: var(--navy-deep); color: #fff; font-size: 13px; box-shadow: 0 8px 24px rgba(15, 37, 55, 0.3); }
.toast[hidden] { display: none; }

.foot { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; font-size: 12px; color: var(--muted); padding: 0 4px; }
.link-btn { border: none; background: none; padding: 8px 0; color: var(--navy); text-decoration: underline; font-size: 12px; min-height: 44px; }

/* Inbox omni-channel */
.inbox {
  display: grid; grid-template-columns: minmax(300px, 380px) minmax(0, 1fr);
  height: clamp(520px, calc(100dvh - 320px), 1000px);
  background: var(--card); border-radius: var(--radius-card); overflow: hidden;
}
.inbox-list { display: flex; flex-direction: column; min-height: 0; min-width: 0; border-right: 1px solid var(--line); }
.inbox-tools { padding: 18px 18px 12px; display: flex; flex-direction: column; gap: 12px; border-bottom: 1px solid var(--line); }
.tabs { display: grid; grid-template-columns: 1fr 1fr; padding: 4px; border-radius: 999px; background: #eef1f5; }
.tabs button { min-height: 40px; border: none; border-radius: 999px; background: transparent; font-size: 13px; font-weight: 500; transition: background-color 0.2s ease, color 0.2s ease; }
.tabs button[aria-pressed='true'] { background: #fff; font-weight: 600; box-shadow: 0 1px 3px rgba(15, 37, 55, 0.12); }
.chip-filters { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }
.chip-filters button { flex: none; min-height: 36px; padding: 0 12px; border-radius: 999px; border: 1px solid #dce2ea; background: #fff; font-size: 12px; transition: background-color 0.2s ease, color 0.2s ease; }
.chip-filters button[aria-pressed='true'] { background: var(--navy); border-color: var(--navy); color: #fff; font-weight: 600; }
.search { position: relative; }
.search input { width: 100%; min-height: 42px; padding: 0 14px 0 38px; border-radius: 12px; border: 1px solid #ccd5e0; background: #fff; }
.search svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.conv-list { list-style: none; margin: 0; padding: 8px; overflow-y: auto; flex: 1; display: flex; flex-direction: column; gap: 4px; }
.conv {
  display: flex; gap: 12px; padding: 12px; border-radius: 14px; text-decoration: none; color: var(--navy);
  transition: background-color 0.15s ease;
}
.conv:hover { background: var(--tile); color: var(--navy); }
.conv[aria-current='true'] { background: #eef2f8; }
.conv-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.conv-top { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; color: var(--muted); }
.conv-top strong { color: var(--navy); font-size: 13px; }
.conv-snippet { font-size: 13px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conv-tags { display: flex; gap: 6px; flex-wrap: wrap; }
.conv.unread .conv-snippet { color: var(--navy); font-weight: 600; }
.unread-dot { width: 8px; height: 8px; border-radius: 999px; background: var(--pink); flex: none; margin-top: 6px; }
.channel-ico { width: 18px; height: 18px; border-radius: 6px; display: inline-grid; place-items: center; color: #fff; font-size: 9px; font-weight: 700; flex: none; }
.channel-ico.ig { background: var(--navy); }
.channel-ico.tt { background: var(--pink); }
.channel-tag { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }

.thread { display: flex; flex-direction: column; min-height: 0; min-width: 0; }
.thread-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 20px; border-bottom: 1px solid var(--line); }
.thread-who { display: flex; align-items: center; gap: 12px; min-width: 0; }
.thread-who strong { font-size: 15px; }
.thread-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.thread-actions select { min-height: 40px; padding: 0 12px; border-radius: 999px; border: 1px solid #dce2ea; background: #f6f7fa; font-size: 13px; }
.back-btn { display: none; }
.thread-scroll { flex: 1; overflow-y: auto; padding: 20px; display: flex; flex-direction: column; gap: 14px; background: #fafbfc; }
.post-context { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 14px; background: #fff; border: 1px solid var(--line); max-width: 520px; }
.post-context .tile-main strong { white-space: normal; }
.bubble-row { display: flex; flex-direction: column; gap: 4px; max-width: min(560px, 85%); }
.bubble-row.tim { align-self: flex-end; align-items: flex-end; }
.bubble { padding: 12px 16px; border-radius: 18px 18px 18px 6px; background: #fff; border: 1px solid var(--line); font-size: 14px; line-height: 1.5; }
.bubble-row.tim .bubble { background: var(--navy); color: #fff; border-color: var(--navy); border-radius: 18px 18px 6px 18px; }
.bubble-meta { font-size: 11px; color: var(--muted); }
.wait { font-size: 12px; font-weight: 600; }
.wait.late { color: var(--negative); }
.composer { border-top: 1px solid var(--line); padding: 14px 20px 16px; display: flex; flex-direction: column; gap: 10px; background: #fff; }
.quick { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }
.quick button { flex: none; min-height: 34px; padding: 0 12px; border-radius: 999px; border: 1px solid #dce2ea; background: #f6f7fa; font-size: 12px; transition: background-color 0.15s ease; }
.quick button:hover { background: #e4e9f1; }
.quick .ai { background: var(--pink-wash); border-color: var(--pink-line); color: var(--pink-dark); font-weight: 600; }
.composer textarea { width: 100%; min-height: 72px; max-height: 180px; resize: vertical; padding: 12px 14px; border-radius: 14px; border: 1px solid #ccd5e0; font: inherit; line-height: 1.5; }
.composer-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.thread-empty { flex: 1; display: grid; place-items: center; color: var(--muted); padding: 32px; text-align: center; }

@media (max-width: 900px) {
  .inbox { grid-template-columns: minmax(0, 1fr); height: auto; min-height: 0; }
  .inbox-list, .thread { min-width: 0; }
  .inbox-list { border-right: none; }
  .inbox.has-thread .inbox-list { display: none; }
  .inbox:not(.has-thread) .thread { display: none; }
  .conv-list { max-height: none; overflow: visible; }
  .thread-scroll { min-height: 34vh; }
  .composer textarea { min-height: 60px; }
  .kbd-hint { display: none; }
  .back-btn { display: inline-flex; }
  #view:has(.inbox.has-thread) > .hero { display: none; }
  .composer { position: sticky; bottom: calc(84px + env(safe-area-inset-bottom)); z-index: 5; border-radius: 0 0 var(--radius-card) var(--radius-card); box-shadow: 0 -8px 24px rgba(15, 37, 55, 0.08); }
}

@media (max-width: 720px) {
  body { padding-bottom: calc(76px + env(safe-area-inset-bottom)); }
  .frame { padding: 16px 14px 24px; gap: 22px; }
  .nav {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; gap: 0; flex-wrap: nowrap;
    display: grid; grid-template-columns: repeat(5, minmax(0, 1fr));
    padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
    background: rgba(15, 37, 55, 0.96); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
  }
  .nav a { flex-direction: column; gap: 3px; min-height: 58px; padding: 4px 2px; border: none; background: transparent; font-size: 11px; border-radius: 14px; position: relative; }
  .nav a[aria-current='page'] { background: rgba(255, 255, 255, 0.14); }
  .nav a svg { width: 20px; height: 20px; }
  .topbar { flex-wrap: nowrap; }
  .top-actions .avatar { display: none; }
  .nav-count { position: absolute; top: 4px; right: calc(50% - 22px); min-width: 18px; height: 18px; font-size: 10px; }
  .card { padding: 18px; }
  .card-dark { padding: 22px; }
  .stat-grid { grid-template-columns: 1fr; }
  .funnel { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .big-number { font-size: 30px; }
  .toast { bottom: calc(88px + env(safe-area-inset-bottom)); }
}

/* Motion: hanya opacity dan transform agar ringan. */
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes grow-y { from { transform: scaleY(0); } to { transform: scaleY(1); } }
@keyframes grow-x { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes draw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(6px) scale(0.98); } to { opacity: 1; transform: none; } }
@keyframes bubble-in { from { opacity: 0; transform: translateY(8px) scale(0.98); } to { opacity: 1; transform: none; } }

#view[data-anim='route'] .stagger { animation: rise 0.42s cubic-bezier(0.2, 0.7, 0.2, 1) both; animation-delay: calc(var(--i, 0) * 45ms); }
#view[data-anim='update'] .stagger { animation: fade-in 0.22s ease-out both; }
#view[data-anim] .chart rect[data-tip], #view[data-anim] .segments i, #view[data-anim] .bar span {
  transform-box: fill-box; transform-origin: 50% 100%;
  animation: grow-y 0.6s cubic-bezier(0.2, 0.7, 0.2, 1) both; animation-delay: calc(var(--i, 0) * 45ms + 120ms);
}
#view[data-anim] .bar span, #view[data-anim] .topic-bar i { transform-origin: 0 50%; animation-name: grow-x; }
#view[data-anim] .topic-bar i { animation: grow-x 0.6s cubic-bezier(0.2, 0.7, 0.2, 1) both; animation-delay: calc(var(--i, 0) * 45ms + 120ms); }
#view[data-anim] .chart .draw { stroke-dasharray: 1; animation: draw 0.9s cubic-bezier(0.3, 0.6, 0.2, 1) both; animation-delay: calc(var(--i, 0) * 45ms + 150ms); }
#view[data-anim='route'] .conv { animation: rise 0.32s ease-out both; animation-delay: calc(min(var(--n, 0), 10) * 25ms); }
.thread-scroll.enter > * { animation: fade-in 0.25s ease-out both; }
.bubble-row.new { animation: bubble-in 0.3s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
.popover:not([hidden]) { animation: pop 0.18s ease-out; transform-origin: top right; }
dialog[open] { animation: pop 0.2s ease-out; }
dialog[open]::backdrop { animation: fade-in 0.2s ease-out; }
.toast:not([hidden]) { animation: pop 0.22s ease-out; }
.btn, .seg button, .filters button, .icon-btn, .link-btn { transition: background-color 0.18s ease, color 0.18s ease, border-color 0.18s ease, transform 0.18s ease; }
.btn:active, .seg button:active, .filters button:active { transform: scale(0.97); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

@media print {
  body { background: #fff; padding: 0; }
  .frame { background: #fff; padding: 0; }
  .nav, .top-actions, .hero-actions, .seg, .foot, .btn, .filters, .comment-actions { display: none !important; }
  .hero, .hero p, .brand, .brand-text span { color: var(--navy) !important; }
  .chip { background: #eef2f8; color: var(--navy); }
  .card, .card-dark { break-inside: avoid; border: 1px solid var(--line); }
  .card-dark { background: #fff; color: var(--navy); }
  .card-dark p { color: var(--text-2); }
}
