/* Tema diturunkan dari WABlast (sidebar, kartu, tombol, aksen), default gelap,
   dengan palet data yang colorful. */
:root {
  --bg: #f7f7f8;
  --surface: #ffffff;
  --surface-2: #f4f4f6;
  --surface-3: #ececf0;
  --border: #dcdce1;
  --grid: #e8e8ec;
  --text: #18181b;
  --text-muted: #71717a;
  --brand: #a5741f;
  --brand-contrast: #fdfaf2;
  --up: #0f9f5f;
  --down: #e5484d;
  --asing: #e8590c;
  --lokal: #7c4dff;
  --gov: #0284c7;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
}
.dark {
  /* gelap netral ala terminal: hitam-abu tanpa semburat biru */
  --bg: #141414;
  --surface: #1c1c1c;
  --surface-2: #232323;
  --surface-3: #2c2c2c;
  --border: #323232;
  --grid: #292929;
  --text: #ececec;
  --text-muted: #9a9a9a;
  --brand: #e0b25c;
  --brand-contrast: #171408;
  --up: #3ddc84;
  --down: #ff5c5c;
  --asing: #ff9f43;
  --lokal: #b18cff;
  --gov: #38bdf8;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
}
[data-accent='matcha'] { --brand: #8fb15a; --brand-contrast: #0d1207; }
[data-accent='blue'] { --brand: #3aa5d9; --brand-contrast: #fff; }
[data-accent='pink'] { --brand: #d0659a; --brand-contrast: #fff; }
[data-accent='orange'] { --brand: #d98a3d; --brand-contrast: #fff; }
[data-accent='purple'] { --brand: #9a6fc0; --brand-contrast: #fff; }
[data-accent='red'] { --brand: #d0605a; --brand-contrast: #fff; }
[data-accent='slate'] { --brand: #6b7f9e; --brand-contrast: #fff; }
[data-accent='gold'] { --brand: #c7b04f; --brand-contrast: #1a1606; }

* { box-sizing: border-box; border-color: var(--border); }
html, body, #root { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }
input, select, textarea { font: inherit; }
:root { --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.num { font-variant-numeric: tabular-nums; }
/* angka & kode saham/broker pakai monospace - rapi berjajar seperti terminal */
.ledger td, .stat-val, .code, .cell .v, .cell .l, .cell .a, .badge.num { font-family: var(--mono); font-size: 0.93em; }
.ledger td .reason, .ledger td .small.muted, .ledger td a:not(.code) { font-family: 'Inter', system-ui, sans-serif; }
.muted { color: var(--text-muted); }
.up { color: var(--up); }
.down { color: var(--down); }
.small { font-size: 12px; }
.bold { font-weight: 600; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.grow { flex: 1; min-width: 0; }
.row { display: flex; align-items: center; gap: 8px; }
.wrap { flex-wrap: wrap; }
.stack > * + * { margin-top: 16px; }

/* ---------------------------------------------------------------- layout */
.shell { display: flex; height: 100vh; overflow: hidden; }
.sidebar {
  width: 236px; flex-shrink: 0; display: flex; flex-direction: column;
  background: var(--surface); border-right: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 10px; padding: 20px 20px 18px; }
.logo { width: 32px; height: 32px; display: grid; place-items: center; color: var(--brand); }
.brand-name { font-size: 18px; font-weight: 700; letter-spacing: .02em; color: var(--brand); }
.brand-sub { font-size: 11px; color: var(--text-muted); margin-top: 1px; }
.nav { flex: 1; overflow-y: auto; padding: 0 12px; }
.nav-title { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted); padding: 14px 12px 6px; }
.navlink {
  display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 9px;
  color: var(--text-muted); font-weight: 500; transition: background .12s, color .12s; cursor: pointer;
}
.navlink:hover { background: color-mix(in srgb, var(--brand) 12%, transparent); color: var(--text); }
.navlink.active { background: color-mix(in srgb, var(--brand) 16%, transparent); color: var(--brand); }
.side-foot { border-top: 1px solid var(--border); padding: 12px; }
.conn { display: flex; align-items: center; gap: 8px; padding: 6px 8px 10px; font-size: 12px; }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; overflow: hidden; }
.content { flex: 1; overflow-y: auto; }
.container { max-width: 1320px; margin: 0 auto; padding: 28px 32px 60px; }
.mobile-top { display: none; }
.scrim { display: none; }

@media (max-width: 960px) {
  .sidebar { position: fixed; inset: 0 auto 0 0; z-index: 40; transform: translateX(-100%); transition: transform .2s; width: 260px; }
  .sidebar.open { transform: none; }
  .scrim.open { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 30; }
  .mobile-top { display: flex; align-items: center; gap: 10px; padding: 10px 16px; border-bottom: 1px solid var(--border); background: var(--surface); }
  .container { padding: 20px 16px 48px; }
}

/* ------------------------------------------------------------ components */
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 22px; }
.page-head h1 { margin: 0; font-size: 24px; font-weight: 650; letter-spacing: -0.015em; }
.page-head p { margin: 4px 0 0; color: var(--text-muted); }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 18px 20px; min-width: 0; }
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.card-title { font-size: 16px; font-weight: 600; }
.card-sub { font-size: 13px; color: var(--text-muted); margin-top: 3px; }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.span2 { grid-column: span 2; }
@media (max-width: 1100px) { .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 760px) { .g2, .g3, .g4 { grid-template-columns: minmax(0, 1fr); } .span2 { grid-column: auto; } }

.stat { display: flex; align-items: center; gap: 14px; height: 100%; }
.stat-ico { width: 44px; height: 44px; border-radius: 11px; display: grid; place-items: center; flex-shrink: 0; }
.stat-val { font-size: 22px; font-weight: 650; font-variant-numeric: tabular-nums; }
.stat-lbl { font-size: 13px; color: var(--text-muted); line-height: 1.35; }
.stat-sub { font-size: 12px; color: var(--text-muted); opacity: .8; margin-top: 2px; line-height: 1.35; }
.stat-link-txt { font-size: 12px; color: var(--brand); margin-top: 4px; font-weight: 550; }
.stat-click { cursor: pointer; transition: border-color .12s, background .12s; }
.stat-click:hover { border-color: color-mix(in srgb, var(--brand) 45%, var(--border)); background: color-mix(in srgb, var(--brand) 5%, var(--surface)); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; border-radius: 9px;
  padding: 8px 14px; font-size: 13.5px; font-weight: 550; border: 1px solid transparent; cursor: pointer;
  transition: filter .12s, background .12s, border-color .12s; background: transparent; white-space: nowrap;
}
.btn:disabled { opacity: .5; pointer-events: none; }
.btn-primary { background: var(--brand); color: var(--brand-contrast); }
.btn-primary:hover { filter: brightness(1.08); }
.btn-ghost { border-color: var(--border); }
.btn-ghost:hover { background: color-mix(in srgb, var(--brand) 12%, transparent); border-color: color-mix(in srgb, var(--brand) 35%, var(--border)); }
.btn-danger { background: #ef4444; color: #fff; }
.btn-icon { width: 36px; height: 36px; padding: 0; }
.btn-sm { padding: 5px 10px; font-size: 12.5px; }

.input, .select {
  width: 100%; border-radius: 9px; border: 1px solid var(--border); padding: 8px 11px; outline: none;
  background: var(--surface-2); color: var(--text); transition: border-color .12s, box-shadow .12s;
}
.input:focus, .select:focus { border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 20%, transparent); }
.label { display: block; font-size: 13px; font-weight: 500; margin-bottom: 6px; }
.field { min-width: 0; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  border: 1px solid var(--border); border-radius: 999px; padding: 5px 12px; font-size: 12.5px; cursor: pointer;
  color: var(--text-muted); background: transparent; transition: all .12s; white-space: nowrap;
}
.chip:hover { color: var(--text); border-color: color-mix(in srgb, var(--brand) 40%, var(--border)); }
.chip.on { color: var(--brand); border-color: var(--brand); background: color-mix(in srgb, var(--brand) 12%, transparent); font-weight: 600; }

.badge { display: inline-flex; align-items: center; gap: 5px; border-radius: 999px; padding: 2px 9px; font-size: 11.5px; font-weight: 550; white-space: nowrap; }
.dot { width: 7px; height: 7px; border-radius: 99px; display: inline-block; flex-shrink: 0; }
.code { font-weight: 650; letter-spacing: .01em; }
.arrow { color: var(--text-muted); margin: 0 5px; }

.banner {
  display: flex; flex-wrap: wrap; align-items: center; gap: 14px; border-radius: 14px; padding: 16px 20px; margin-bottom: 18px;
  border: 1px solid color-mix(in srgb, var(--brand) 40%, var(--border));
  background: color-mix(in srgb, var(--brand) 10%, var(--surface));
}
.progress { height: 6px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.progress > div { height: 100%; border-radius: 99px; background: var(--brand); transition: width .3s; }

/* ------------------------------------------------------ ledger tables */
.ledger { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.ledger th {
  text-align: left; font-size: 11.5px; font-weight: 550; color: var(--text-muted); text-transform: uppercase;
  letter-spacing: .04em; padding: 0 10px 8px; white-space: nowrap; border-bottom: 1px solid var(--border);
}
.ledger td { padding: 8px 10px; border-bottom: 1px solid color-mix(in srgb, var(--border) 45%, transparent); vertical-align: middle; }
.ledger tr:last-child td { border-bottom: 0; }
.ledger th.right, .ledger td.right { text-align: right; white-space: nowrap; }
.ledger tbody tr.click { cursor: pointer; }
.ledger tbody tr.click:hover td { background: color-mix(in srgb, var(--brand) 6%, transparent); }
.ledger .reason { font-size: 12px; color: var(--text-muted); margin-top: 3px; line-height: 1.45; max-width: 640px; }
.scroll-x { overflow-x: auto; }
.tight td { padding: 6px 8px; }
.tight th { padding: 0 8px 7px; }

/* -------------------------------------------------------------- chart card */
.toggle { display: inline-flex; gap: 2px; padding: 3px; border-radius: 10px; background: var(--surface-2); }
.toggle button { border: 0; background: transparent; width: 34px; height: 30px; border-radius: 8px; display: grid; place-items: center; color: var(--text-muted); cursor: pointer; }
.toggle button.on { background: var(--surface-3); color: var(--text); box-shadow: inset 0 0 0 1px var(--border); }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 10px; font-size: 13px; }
.legend span { display: inline-flex; align-items: center; gap: 7px; }
.legend i { width: 11px; height: 11px; border-radius: 3px; display: inline-block; }

/* -------------------------------------------------------------- gauge */
.gauge { position: relative; height: 10px; border-radius: 99px; display: flex; gap: 3px; margin: 14px 0 6px; }
.gauge > div { flex: 1; border-radius: 3px; }
.gauge .mark { position: absolute; top: -5px; width: 4px; height: 20px; border-radius: 3px; background: var(--text); box-shadow: 0 0 0 3px var(--surface); transform: translateX(-2px); transition: left .3s; }

/* ------------------------------------------------------------ calendar */
.months { display: grid; gap: 18px; grid-template-columns: repeat(auto-fill, minmax(420px, 1fr)); }
@media (max-width: 560px) { .months { grid-template-columns: minmax(0, 1fr); } }
.cal-head { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; margin-bottom: 6px; font-size: 11px; color: var(--text-muted); text-align: center; letter-spacing: .06em; }
.cal { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.cell { min-height: 74px; border-radius: 9px; padding: 6px 8px; background: var(--surface-2); font-size: 11.5px; display: flex; flex-direction: column; position: relative; }
.cell.out { background: transparent; }
.cell .d { color: var(--text-muted); font-size: 11px; }
.cell .v { font-weight: 650; font-size: 13px; text-align: right; margin-top: 2px; }
.cell .l, .cell .a { text-align: right; color: var(--text-muted); font-size: 11px; }
.cell.today { outline: 2px solid var(--brand); outline-offset: -2px; }

/* --------------------------------------------------------------- modal */
.modal-bg { position: fixed; inset: 0; background: rgba(0, 0, 0, .55); display: grid; place-items: center; padding: 16px; z-index: 60; }
.modal { width: 100%; max-width: 720px; max-height: 92vh; overflow-y: auto; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 22px; box-shadow: var(--shadow); }
/* bot portfolio: broker-app look - box strip, underline tabs, two-line rows */
.pstrip { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2); margin-bottom: 12px; }
.pbox { padding: 10px 12px; text-align: center; border-left: 1px solid var(--border); }
.pbox:first-child { border-left: 0; }
.ptabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); overflow-x: auto; }
.ptab { background: none; border: 0; border-bottom: 2px solid transparent; padding: 8px 14px; color: var(--text-muted); cursor: pointer; font: inherit; font-family: 'Inter', system-ui, sans-serif; white-space: nowrap; }
.ptab.on { color: var(--text); border-bottom-color: var(--brand); font-weight: 600; }
.prow { display: grid; grid-template-columns: 1.1fr 1fr 1fr 1fr; gap: 10px; align-items: start; padding: 10px 2px; }
.phead { color: var(--text-muted); border-bottom: 1px solid var(--border); font-family: 'Inter', system-ui, sans-serif; }
.pline { border-bottom: 1px solid var(--border); }
@media (max-width: 600px) { .pstrip { grid-template-columns: repeat(2, minmax(0, 1fr)); } .pbox:nth-child(3) { border-left: 0; } .pbox:nth-child(n+3) { border-top: 1px solid var(--border); } }
.form-grid { display: grid; gap: 14px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-grid .full { grid-column: 1 / -1; }
@media (max-width: 600px) { .form-grid { grid-template-columns: minmax(0, 1fr); } }

.empty { text-align: center; padding: 42px 16px; color: var(--text-muted); }
.empty b { display: block; color: var(--text); font-weight: 600; margin-bottom: 4px; font-size: 15px; }
.err { color: var(--down); font-size: 13px; }
.spin { width: 16px; height: 16px; border-radius: 99px; border: 2px solid var(--border); border-top-color: var(--brand); animation: sp .8s linear infinite; display: inline-block; }
@keyframes sp { to { transform: rotate(360deg); } }
.skeleton { height: 120px; border-radius: 10px; background: var(--surface-2); animation: skp 1.2s ease-in-out infinite; }
@keyframes skp { 50% { background: var(--surface-3); } }
@keyframes sk { to { background-position: -200% 0; } }
.story { margin: 0; padding-left: 18px; line-height: 1.65; }
.story b { color: var(--brand); }
.search { position: relative; }
.search .input { padding-left: 34px; }
.search svg { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--text-muted); }
.pop { position: absolute; z-index: 50; top: calc(100% + 6px); left: 0; right: 0; max-height: 300px; overflow-y: auto; background: var(--surface); border: 1px solid var(--border); border-radius: 11px; box-shadow: var(--shadow); padding: 4px; }
.pop div { padding: 7px 10px; border-radius: 7px; cursor: pointer; display: flex; gap: 10px; }
.pop div:hover, .pop div.hl { background: color-mix(in srgb, var(--brand) 12%, transparent); }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 99px; }

.stat-link { display: block; cursor: pointer; border-radius: 14px; }
.stat-link .card { transition: border-color .12s, background .12s; }
.stat-link:hover .card { border-color: color-mix(in srgb, var(--brand) 45%, var(--border)); background: color-mix(in srgb, var(--brand) 5%, var(--surface)); }
.ledger td.small, .ledger .reason { font-family: 'Inter', system-ui, sans-serif; }

/* ---------------------------------------------------- konsistensi tata letak */
/* kartu dalam satu baris grid selalu sama tinggi */
.grid { align-items: stretch; }
.grid > .card, .grid > div > .card:only-child, .grid > .span2 > .card { height: 100%; }
.grid > .span2, .grid > div:has(> .card:only-child) { display: flex; flex-direction: column; }
.grid > .span2 > .card, .grid > div:has(> .card:only-child) > .card { flex: 1; }
/* subjudul kartu tidak patah jelek */
.card-sub { text-wrap: pretty; }
.card-head > div:first-child { min-width: 0; flex: 1; }
/* aturan huruf: teks = Inter, angka & kode = monospace */
.stat-val { font-family: var(--mono); }
.stat-lbl, .stat-sub, .stat-link-txt, .card-title, .card-sub, .chip, .btn, th { font-family: 'Inter', system-ui, sans-serif; }

/* kolom broker/alasan di tabel Per saham tidak menyempit jadi tiang tinggi */
.col-who { min-width: 340px; max-width: 520px; }
.clamp2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.clamp2:hover { -webkit-line-clamp: unset; }

/* ---------------------------------------------------- bento (Market Pulse) */
.bento { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 16px; }
.bento > .card { border-radius: 18px; }
.c-3 { grid-column: span 3; } .c-4 { grid-column: span 4; } .c-6 { grid-column: span 6; }
.c-8 { grid-column: span 8; } .c-12 { grid-column: span 12; }
@media (max-width: 1200px) { .c-3 { grid-column: span 6; } .c-4, .c-8 { grid-column: span 12; } }
@media (max-width: 1000px) { .c-6 { grid-column: span 12; } }
@media (max-width: 760px) { .bento > * { grid-column: span 12; } }
.mstat { display: flex; flex-direction: column; gap: 4px; }
.card.hero { background: color-mix(in srgb, var(--brand) 9%, var(--surface));
  border-color: color-mix(in srgb, var(--brand) 45%, var(--border)); }
.stat-ico.sm { width: 30px; height: 30px; border-radius: 9px; }
.big-num { font-family: var(--mono); font-size: 27px; font-weight: 700; letter-spacing: -.5px; line-height: 1.2; margin-top: 4px; }
.range-bar { position: relative; height: 6px; border-radius: 99px;
  background: var(--surface-3); }
.range-bar i { position: absolute; top: -5px; width: 16px; height: 16px; border-radius: 50%; background: var(--text);
  border: 4px solid var(--surface); transform: translateX(-50%); box-shadow: 0 0 0 1px var(--border); }
.split { display: flex; height: 6px; border-radius: 99px; overflow: hidden; background: var(--surface-3); gap: 2px; }
.split > span { display: block; height: 100%; }
.daystrip { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }
.day { min-width: 50px; padding: 6px 6px 5px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface);
  color: var(--text-muted); text-align: center; cursor: pointer; font: 500 11.5px Inter, system-ui, sans-serif; }
.day b { display: block; font: 700 16px var(--mono); color: var(--text); }
.day i { display: block; height: 3px; border-radius: 2px; margin: 4px 6px 0; }
.day:hover { border-color: color-mix(in srgb, var(--brand) 45%, var(--border)); }
.day.on { border-color: var(--brand); background: color-mix(in srgb, var(--brand) 14%, var(--surface)); color: var(--brand); }
.rank-list { display: flex; flex-direction: column; }
.rank-row, .mv-row { display: grid; align-items: center; gap: 10px; padding: 6px 6px; border-radius: 8px; color: inherit; text-decoration: none;
  border-bottom: 1px solid color-mix(in srgb, var(--border) 45%, transparent); font-size: 13px; }
.rank-row { grid-template-columns: 22px 34px minmax(0, 1fr) minmax(60px, 34%) 74px; }
.mv-row { grid-template-columns: 22px 54px minmax(0, 1fr) 58px 72px 58px 64px; }
.rank-row:hover, .mv-row:hover { background: color-mix(in srgb, var(--brand) 7%, transparent); }
.rank-row .n, .mv-row .n { color: var(--text-muted); font: 11px var(--mono); }
.rank-row .v, .mv-row .v { text-align: right; font-family: var(--mono); }
.rank-row .bar, .mv-row .bar { display: block; height: 8px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.rank-row .bar > span, .mv-row .bar > span { display: block; height: 100%; border-radius: 99px; }
.pill { display: inline-block; font: 600 12px var(--mono); padding: 2px 8px; border-radius: 99px; white-space: nowrap; }
.ellip { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
@media (max-width: 560px) { .mv-row { grid-template-columns: 18px 50px minmax(0, 1fr) 70px 58px; } .mv-row > :nth-child(6), .mv-row > :nth-child(7) { display: none; } }

.lg-item { cursor: pointer; padding: 2px 8px; border-radius: 99px; border: 1px solid transparent; transition: opacity .15s; }
.lg-item:hover { border-color: currentColor; }
.lg-item.on { border-color: currentColor; background: color-mix(in srgb, currentColor 10%, transparent); }
.chip .dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; vertical-align: middle; }

/* live tape: new rows light up briefly */
@keyframes flashrow { from { background: color-mix(in srgb, var(--brand) 22%, transparent); } to { background: transparent; } }
.ledger tr.flash td { animation: flashrow 1.6s ease-out; }
.bar-in { display: inline-block; height: 8px; border-radius: 99px; min-width: 2px; }
.ledger tr.sel td { background: color-mix(in srgb, var(--brand) 10%, transparent); }
/* corporate-action month grid (trading days) */
.cal5 { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.cal5-h { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: .5px; padding: 0 4px; }
.cal5-d { min-height: 92px; border: 1px solid color-mix(in srgb, var(--border) 60%, transparent); border-radius: 10px; padding: 5px 6px; cursor: pointer; overflow: hidden; }
.cal5-d:hover { border-color: var(--brand); }
.cal5-d.past { opacity: .55; }
.cal5-d.today { border-color: var(--brand); background: color-mix(in srgb, var(--brand) 7%, transparent); }
.cal5-d.sel { outline: 2px solid var(--brand); }
.cal5-d .n { font: 600 12px var(--mono); color: var(--text-muted); margin-bottom: 3px; }
.cal5-d .ev { font-size: 11px; line-height: 1.35; border-left: 3px solid; padding-left: 5px; margin-bottom: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal5-d .ev span { color: var(--text-muted); }
.cal5-d .more { font-size: 10.5px; color: var(--text-muted); }
@media (max-width: 760px) { .cal5-d { min-height: 64px; } .cal5-d .ev span { display: none; } }
.card-head { flex-wrap: wrap; }
.card-head > div:first-child { flex: 1 1 300px; min-width: 0; }
/* bento columns follow the width of the content area (the sidebar takes part of the window) */
.content { container-type: inline-size; }
@container (max-width: 1020px) { .c-3 { grid-column: span 6; } .c-4, .c-8 { grid-column: span 12; } }
@container (max-width: 860px) { .c-6 { grid-column: span 12; } }
@container (max-width: 560px) { .bento > * { grid-column: span 12; } }
.wave { border-left: 3px solid; padding: 7px 10px; margin-bottom: 6px; border-radius: 0 8px 8px 0; background: color-mix(in srgb, var(--surface-3) 40%, transparent); }
.wave.click { cursor: pointer; }
.wave.click:hover { background: color-mix(in srgb, var(--brand) 8%, transparent); }

/* Grow Intelligence - the knowledge tree: leaves grow in, branches sway gently */
.grow-tree { width: 100%; height: auto; max-height: 470px; display: block; }
.grow-label { fill: var(--text); font-size: 15px; font-weight: 600; }
.grow-leaf { animation: grow-in .6s cubic-bezier(.2,.9,.3,1.3) both; }
.grow-branch { animation: grow-sway 7s ease-in-out infinite alternate; transition: opacity .3s; }
@keyframes grow-in { from { transform: scale(0); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes grow-sway { from { transform: rotate(-0.8deg); } to { transform: rotate(0.8deg); } }
@media (prefers-reduced-motion: reduce) { .grow-leaf, .grow-branch { animation: none; } }
