/* Entastack — product mockup stylesheet */
:root {
  --ink: #15171b;
  --ink-2: #3b3f47;
  --muted: #6b7079;
  --faint: #9aa0a8;
  --line: #e3e5e8;
  --line-2: #eef0f2;
  --bg: #f6f7f8;
  --surface: #ffffff;
  --accent: #2b55a8;
  --accent-ink: #1f3f80;
  --accent-soft: #eaf0fa;
  --good: #1f7a4d;
  --good-soft: #e7f4ec;
  --warn: #9a6400;
  --warn-soft: #fbf2df;
  --bad: #b3261e;
  --bad-soft: #fbeae8;
  --info-soft: #eef1f5;
  --radius: 6px;
  --shadow: 0 1px 2px rgba(16, 18, 22, .06), 0 1px 1px rgba(16, 18, 22, .03);
  --shadow-lg: 0 12px 32px rgba(16, 18, 22, .14), 0 2px 6px rgba(16, 18, 22, .06);
  --font: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -0.01em; }
h1 { font-size: 22px; }
h2 { font-size: 16px; }
h3 { font-size: 14px; }
p { margin: 0; }
.mono { font-family: var(--mono); font-size: 12.5px; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: 12.5px; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.row { display: flex; align-items: center; gap: 8px; }
.row.between { justify-content: space-between; }
.stack > * + * { margin-top: 16px; }
.grow { flex: 1; min-width: 0; }
.hidden { display: none !important; }
svg.i { width: 16px; height: 16px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Buttons & inputs ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 34px; padding: 0 14px;
  font: 500 13.5px/1 var(--font);
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--surface); color: var(--ink);
  cursor: pointer; white-space: nowrap;
  transition: background .12s, border-color .12s;
}
.btn:hover { background: #f1f2f4; text-decoration: none; }
.btn.primary { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn.primary:hover { background: #2a2d33; }
.btn.accent { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.accent:hover { background: var(--accent-ink); }
.btn.ghost { border-color: transparent; background: transparent; color: var(--ink-2); }
.btn.ghost:hover { background: #eceef0; }
.btn.danger { color: var(--bad); }
.btn.sm { height: 28px; padding: 0 10px; font-size: 12.5px; }
.btn.lg { height: 42px; padding: 0 20px; font-size: 15px; }
.btn.block { width: 100%; }
.btn:focus-visible, .input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 1px;
}

.input, select.input, textarea.input {
  width: 100%; height: 36px; padding: 0 10px;
  font: 14px var(--font); color: var(--ink);
  border: 1px solid #d5d8dc; border-radius: var(--radius); background: #fff;
}
textarea.input { height: auto; padding: 9px 10px; resize: none; line-height: 1.45; }
label.lbl { display: block; font-weight: 500; font-size: 13px; margin-bottom: 6px; color: var(--ink-2); }

/* ---------- Badges / pills ---------- */
.pill {
  display: inline-flex; align-items: center; gap: 5px;
  height: 22px; padding: 0 8px; border-radius: 4px;
  font-size: 12px; font-weight: 500; white-space: nowrap;
  background: var(--info-soft); color: var(--ink-2);
}
.pill .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill.good { background: var(--good-soft); color: var(--good); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.bad { background: var(--bad-soft); color: var(--bad); }
.pill.accent { background: var(--accent-soft); color: var(--accent-ink); }
.pill.outline { background: transparent; border: 1px solid var(--line); }
.tag { font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }

/* ---------- Cards ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow); }
.card-h { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--line-2); }
.card-h h2 { font-size: 14px; }
.card-b { padding: 16px; }
.card-f { padding: 10px 16px; border-top: 1px solid var(--line-2); font-size: 13px; }

.grid { display: grid; gap: 16px; }
.g-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g-main { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }

/* KPI tiles */
.kpi { padding: 14px 16px; }
.kpi .k-label { font-size: 12.5px; color: var(--muted); }
.kpi .k-value { font-size: 26px; font-weight: 600; letter-spacing: -0.02em; margin-top: 4px; font-variant-numeric: tabular-nums; }
.kpi .k-sub { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.delta-up { color: var(--good); font-weight: 500; }
.delta-down { color: var(--bad); font-weight: 500; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; }
table.t { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.t th {
  text-align: left; font-weight: 500; font-size: 12px; color: var(--muted);
  padding: 9px 16px; border-bottom: 1px solid var(--line); background: #fafbfb; white-space: nowrap;
}
table.t td { padding: 10px 16px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
table.t tr:last-child td { border-bottom: 0; }
table.t tbody tr.click { cursor: pointer; }
table.t tbody tr.click:hover td { background: #fafbfc; }
table.t td.num, table.t th.num { text-align: right; font-variant-numeric: tabular-nums; }

.person { display: flex; align-items: center; gap: 10px; min-width: 0; }
.avatar {
  width: 28px; height: 28px; border-radius: 50%; flex: none;
  display: grid; place-items: center;
  font-size: 11px; font-weight: 600; color: var(--ink-2); background: #e4e7eb;
}
.avatar.lg { width: 44px; height: 44px; font-size: 15px; }
.person .nm { font-weight: 500; }
.person .sub { font-size: 12px; color: var(--muted); }

.bar { height: 6px; background: #eceef1; border-radius: 3px; overflow: hidden; min-width: 80px; }
.bar > i { display: block; height: 100%; background: var(--accent); border-radius: 3px; }
.bar.good > i { background: var(--good); }
.bar.warn > i { background: #c98a12; }

/* ---------- Steps (provisioning) ---------- */
.steps { display: flex; gap: 4px; align-items: center; }
.step-dot { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; border: 1px solid var(--line); background: #fff; color: var(--faint); }
.step-dot svg.i { width: 12px; height: 12px; stroke-width: 2.2; }
.step-dot.ok { background: var(--good-soft); border-color: #bfe0cc; color: var(--good); }
.step-dot.run { background: var(--accent-soft); border-color: #c5d4ef; color: var(--accent); }
.step-dot.warn { background: var(--warn-soft); border-color: #ecd6a5; color: var(--warn); }
.step-dot.bad { background: var(--bad-soft); border-color: #efc4c0; color: var(--bad); }
.step-line { width: 10px; height: 1px; background: var(--line); }

.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { position: relative; padding: 0 0 16px 32px; }
.timeline li:last-child { padding-bottom: 0; }
.timeline li::before { content: ""; position: absolute; left: 10px; top: 24px; bottom: 0; width: 1px; background: var(--line); }
.timeline li:last-child::before { display: none; }
.timeline .step-dot { position: absolute; left: 0; top: 0; }
.timeline .t-title { font-weight: 500; }
.timeline .t-meta { font-size: 12.5px; color: var(--muted); }

/* ---------- App shell ---------- */
.app { display: grid; grid-template-columns: 236px minmax(0, 1fr); min-height: 100vh; }
.side {
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  background: #fbfbfc; border-right: 1px solid var(--line);
  display: flex; flex-direction: column;
}
.side .brand { display: flex; align-items: center; gap: 10px; padding: 16px 18px 14px; }
.side .brand img { height: 26px; }
.org-switch {
  margin: 0 12px 10px; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--radius);
  background: #fff; display: flex; align-items: center; gap: 10px; font-size: 13px;
}
.org-switch .org-logo { width: 24px; height: 24px; border-radius: 4px; background: #24364f; color: #fff; display: grid; place-items: center; font-weight: 600; font-size: 11px; }
.org-switch .org-sub { font-size: 11.5px; color: var(--muted); }
.nav { padding: 6px 10px; }
.nav .sec { font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--faint); padding: 14px 8px 6px; }
.nav a {
  display: flex; align-items: center; gap: 10px; padding: 7px 8px; border-radius: 5px;
  color: var(--ink-2); font-weight: 500; font-size: 13.5px;
}
.nav a:hover { background: #eef0f2; text-decoration: none; }
.nav a.on { background: #e9ecf0; color: var(--ink); }
.nav a.on svg.i { color: var(--accent); }
.nav a .count { margin-left: auto; font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.side .side-foot { margin-top: auto; padding: 12px 14px; border-top: 1px solid var(--line); font-size: 12px; color: var(--muted); }

.top {
  position: sticky; top: 0; z-index: 20; height: 56px;
  display: flex; align-items: center; gap: 12px; padding: 0 24px;
  background: rgba(255, 255, 255, .96); border-bottom: 1px solid var(--line);
}
.crumbs { font-size: 13px; color: var(--muted); }
.crumbs b { color: var(--ink); font-weight: 500; }
.search {
  margin-left: auto; position: relative; width: 280px;
}
.search input { padding-left: 32px; height: 32px; background: #f6f7f8; border-color: var(--line); font-size: 13px; }
.search svg.i { position: absolute; left: 10px; top: 8px; color: var(--muted); }
.search kbd { position: absolute; right: 8px; top: 7px; font: 11px var(--mono); color: var(--muted); border: 1px solid var(--line); border-radius: 3px; padding: 0 4px; background: #fff; }
.icon-btn { width: 32px; height: 32px; display: grid; place-items: center; border-radius: var(--radius); border: 0; background: transparent; color: var(--ink-2); cursor: pointer; position: relative; }
.icon-btn:hover { background: #eef0f2; }
.icon-btn .nd { position: absolute; top: 7px; right: 7px; width: 7px; height: 7px; border-radius: 50%; background: var(--bad); border: 1.5px solid #fff; }
.user-btn { display: flex; align-items: center; gap: 8px; padding: 4px 8px 4px 4px; border-radius: 20px; border: 1px solid var(--line); background: #fff; cursor: pointer; font: 500 13px var(--font); color: var(--ink); }
.user-btn:hover { background: #f6f7f8; }

.menu {
  position: absolute; right: 24px; top: 52px; width: 270px; z-index: 40;
  background: #fff; border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow-lg); padding: 6px;
}
.menu .m-h { padding: 8px 10px 10px; border-bottom: 1px solid var(--line-2); margin-bottom: 4px; }
.menu .m-sec { font-size: 11px; color: var(--faint); padding: 8px 10px 4px; text-transform: uppercase; letter-spacing: .06em; font-weight: 600; }
.menu button { display: flex; width: 100%; align-items: center; gap: 10px; padding: 7px 10px; border: 0; background: none; border-radius: 5px; font: 13.5px var(--font); color: var(--ink); cursor: pointer; text-align: left; }
.menu button:hover { background: #f1f2f4; }
.menu button .chk { margin-left: auto; color: var(--accent); }

.demo-bar {
  background: var(--ink); color: #d6d9de; font-size: 12.5px;
  display: flex; align-items: center; justify-content: center; gap: 10px; height: 30px; padding: 0 16px;
}
.demo-bar b { color: #fff; font-weight: 500; }
.demo-bar a { color: #fff; text-decoration: underline; }

.main { min-width: 0; }
.page { padding: 24px; max-width: 1360px; }
.page-h { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.page-h p { color: var(--muted); margin-top: 4px; }

.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 16px; }
.tabs button { border: 0; background: none; padding: 8px 12px; font: 500 13.5px var(--font); color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs button.on { color: var(--ink); border-bottom-color: var(--ink); }
.tabs button .count { margin-left: 4px; color: var(--faint); font-weight: 400; }

.filters { display: flex; gap: 8px; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--line-2); flex-wrap: wrap; }
.filters .input { height: 30px; font-size: 13px; width: auto; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.seg button { border: 0; background: #fff; padding: 0 10px; height: 28px; font: 500 12.5px var(--font); color: var(--muted); cursor: pointer; border-right: 1px solid var(--line); }
.seg button:last-child { border-right: 0; }
.seg button.on { background: #eef0f3; color: var(--ink); }

/* ---------- Drawer / modal / toast ---------- */
.scrim { position: fixed; inset: 0; background: rgba(21, 23, 27, .32); z-index: 60; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(520px, 100%); z-index: 61;
  background: #fff; box-shadow: var(--shadow-lg); display: flex; flex-direction: column;
  animation: slide .18s ease-out;
}
@keyframes slide { from { transform: translateX(24px); opacity: .6; } to { transform: none; opacity: 1; } }
.drawer-h { padding: 18px 20px; border-bottom: 1px solid var(--line); display: flex; gap: 12px; align-items: flex-start; }
.drawer-b { padding: 20px; overflow-y: auto; flex: 1; }
.drawer-f { padding: 12px 20px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 8px; }
.modal {
  position: fixed; left: 50%; top: 12vh; transform: translateX(-50%); width: min(520px, calc(100% - 32px)); z-index: 61;
  background: #fff; border-radius: 10px; box-shadow: var(--shadow-lg);
}
.modal .card-h { padding: 16px 20px; }
.modal .card-b { padding: 20px; }
.modal .card-f { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 20px; }
.kv { display: grid; grid-template-columns: 140px 1fr; gap: 8px 16px; font-size: 13.5px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }

.toasts { position: fixed; bottom: 20px; right: 20px; z-index: 80; display: flex; flex-direction: column; gap: 8px; }
.toast { background: var(--ink); color: #fff; padding: 10px 14px; border-radius: 6px; font-size: 13.5px; box-shadow: var(--shadow-lg); display: flex; gap: 10px; align-items: center; max-width: 380px; animation: up .2s ease-out; }
.toast svg.i { color: #8fd3ad; }
@keyframes up { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---------- Charts ---------- */
.chart { position: relative; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart .axis { font: 11px var(--font); fill: var(--muted); }
.chart .grid-l { stroke: #eceef1; stroke-width: 1; }
.chart .bar-m { fill: var(--accent); }
.chart .bar-m.dim { fill: #c9d4ea; }
.chart .hit { fill: transparent; cursor: default; }
.chart .hit:hover + .bar-m, .chart .bar-m.hover { fill: var(--accent-ink); }
.tip {
  position: absolute; pointer-events: none; z-index: 5;
  background: #fff; border: 1px solid var(--line); border-radius: 6px; box-shadow: var(--shadow-lg);
  padding: 8px 10px; font-size: 12.5px; white-space: nowrap; transform: translate(-50%, calc(-100% - 10px));
}
.tip b { font-weight: 600; font-variant-numeric: tabular-nums; }
.hbar { display: grid; grid-template-columns: 110px 1fr 48px; gap: 10px; align-items: center; font-size: 13px; padding: 5px 0; }
.hbar .track { height: 8px; background: #eef0f3; border-radius: 4px; }
.hbar .track i { display: block; height: 100%; background: var(--accent); border-radius: 4px; }
.hbar .v { text-align: right; font-variant-numeric: tabular-nums; color: var(--ink-2); }

/* ---------- Feed ---------- */
.feed { list-style: none; margin: 0; padding: 0; }
.feed li { display: flex; gap: 12px; padding: 11px 16px; border-bottom: 1px solid var(--line-2); font-size: 13px; }
.feed li:last-child { border-bottom: 0; }
.feed .f-ico { width: 28px; height: 28px; border-radius: 6px; background: #f1f3f5; color: var(--ink-2); display: grid; place-items: center; flex: none; }
.feed .f-time { color: var(--faint); font-size: 12px; white-space: nowrap; margin-left: auto; }

/* ---------- Checklist ---------- */
.check { display: flex; align-items: flex-start; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line-2); }
.check:last-child { border-bottom: 0; }
.cbox { width: 18px; height: 18px; border-radius: 4px; border: 1.5px solid #c3c7cd; display: grid; place-items: center; flex: none; margin-top: 1px; cursor: pointer; background: #fff; color: #fff; padding: 0; }
.cbox svg.i { width: 12px; height: 12px; stroke-width: 2.6; }
.cbox.on { background: var(--good); border-color: var(--good); }
.check.done .c-title { color: var(--muted); text-decoration: line-through; text-decoration-color: #c3c7cd; }
.check .c-title { font-weight: 500; }
.check .c-meta { font-size: 12.5px; color: var(--muted); margin-top: 2px; display: flex; gap: 10px; flex-wrap: wrap; }
.pts { font-size: 12px; font-weight: 600; color: var(--ink-2); font-variant-numeric: tabular-nums; white-space: nowrap; }

.event { display: flex; gap: 12px; padding: 11px 16px; border-bottom: 1px solid var(--line-2); }
.event:last-child { border-bottom: 0; }
.event .date { width: 44px; text-align: center; flex: none; border: 1px solid var(--line); border-radius: 6px; padding: 3px 0; }
.event .date .m { font-size: 10.5px; text-transform: uppercase; color: var(--bad); font-weight: 600; letter-spacing: .04em; }
.event .date .d { font-size: 17px; font-weight: 600; line-height: 1.1; }

.badge-tile { text-align: center; padding: 14px 8px; border: 1px solid var(--line); border-radius: 8px; }
.badge-tile .medal { width: 44px; height: 44px; margin: 0 auto 8px; border-radius: 50%; display: grid; place-items: center; background: #f1f3f6; color: var(--ink-2); border: 1px solid var(--line); }
.badge-tile.earned .medal { background: var(--ink); color: #fff; border-color: var(--ink); }
.badge-tile .medal svg.i { width: 20px; height: 20px; }
.badge-tile .bn { font-weight: 500; font-size: 13px; }
.badge-tile .bd { font-size: 11.5px; color: var(--muted); }
.badge-tile:not(.earned) { opacity: .65; }

/* ---------- Calendar ---------- */
.cal { display: grid; grid-template-columns: 56px repeat(5, minmax(0, 1fr)); border-top: 1px solid var(--line-2); }
.cal .ch { padding: 10px 8px; font-size: 12.5px; border-bottom: 1px solid var(--line); border-left: 1px solid var(--line-2); }
.cal .ch b { display: block; font-size: 18px; font-weight: 600; }
.cal .ch.today b { color: #fff; background: var(--accent); border-radius: 50%; width: 30px; height: 30px; display: grid; place-items: center; font-size: 15px; }
.cal .hr { height: 52px; font-size: 11px; color: var(--faint); text-align: right; padding: 0 8px; transform: translateY(-7px); }
.cal .col { position: relative; border-left: 1px solid var(--line-2); background-image: linear-gradient(var(--line-2) 1px, transparent 1px); background-size: 100% 52px; }
.cal .ev { position: absolute; left: 4px; right: 4px; border-radius: 5px; padding: 4px 7px; font-size: 12px; line-height: 1.3; background: var(--accent-soft); border-left: 3px solid var(--accent); color: var(--accent-ink); overflow: hidden; }
.cal .ev b { font-weight: 600; display: block; }
.cal .ev.alt { background: #eef4f0; border-left-color: var(--good); color: #175c3a; }
.cal .ev.gray { background: #f1f2f4; border-left-color: #8a9099; color: var(--ink-2); }

/* ---------- Chat ---------- */
.chat-shell { display: grid; grid-template-columns: 260px minmax(0, 1fr) 320px; height: calc(100vh - 56px - 30px); }
.chat-list { border-right: 1px solid var(--line); background: #fbfbfc; overflow-y: auto; }
.chat-list .cl-h { padding: 14px; border-bottom: 1px solid var(--line-2); }
.chat-list .conv { display: block; width: 100%; text-align: left; border: 0; background: none; padding: 10px 14px; cursor: pointer; font: 13px var(--font); color: var(--ink); border-bottom: 1px solid var(--line-2); }
.chat-list .conv:hover { background: #f1f3f5; }
.chat-list .conv.on { background: #e9ecf0; }
.chat-list .conv .ct { font-weight: 500; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-list .conv .cs { font-size: 12px; color: var(--muted); }
.chat-main { display: flex; flex-direction: column; min-width: 0; background: #fff; }
.chat-head { padding: 12px 20px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 10px; }
.chat-scroll { flex: 1; overflow-y: auto; padding: 24px 0; }
.chat-inner { max-width: 760px; margin: 0 auto; padding: 0 24px; }
.msg { margin-bottom: 22px; }
.msg.user { display: flex; justify-content: flex-end; }
.msg.user .bubble { background: #f1f3f6; border-radius: 10px 10px 2px 10px; padding: 10px 14px; max-width: 80%; }
.msg.bot .who { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--muted); margin-bottom: 8px; flex-wrap: wrap; }
.msg.bot .who img { width: 20px; height: 20px; }
.msg.bot .who b { color: var(--ink); font-weight: 600; }
.msg.bot .body { font-size: 14.5px; line-height: 1.6; }
.msg.bot .body > * + * { margin-top: 10px; }
.msg.bot .body ol, .msg.bot .body ul { margin: 0; padding-left: 20px; }
.msg.bot .body li + li { margin-top: 4px; }
.cite {
  display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 4px; margin: 0 1px;
  font: 600 10.5px var(--font); color: var(--accent-ink); background: var(--accent-soft); border-radius: 4px;
  vertical-align: 2px; cursor: pointer; border: 0;
}
.cite:hover, .cite.on { background: var(--accent); color: #fff; }
.sources { margin-top: 14px; display: flex; flex-wrap: wrap; gap: 6px; }
.src-chip { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px; border: 1px solid var(--line); border-radius: 5px; font: 12.5px var(--font); color: var(--ink-2); background: #fff; cursor: pointer; }
.src-chip:hover { border-color: #c9ced5; background: #fafbfc; }
.src-chip .n { font-weight: 600; color: var(--accent-ink); }
.msg-actions { display: flex; gap: 2px; margin-top: 10px; align-items: center; }
.msg-actions .icon-btn { width: 28px; height: 28px; color: var(--muted); }
.msg-actions .icon-btn.on { color: var(--accent); background: var(--accent-soft); }
.notice { border: 1px solid #ecd6a5; background: var(--warn-soft); border-radius: 8px; padding: 12px 14px; font-size: 13.5px; }
.notice.neutral { border-color: var(--line); background: #fafbfc; }
.typing { display: inline-flex; gap: 4px; padding: 6px 0; }
.typing i { width: 6px; height: 6px; border-radius: 50%; background: #b8bdc4; animation: blink 1.2s infinite; }
.typing i:nth-child(2) { animation-delay: .15s; } .typing i:nth-child(3) { animation-delay: .3s; }
@keyframes blink { 0%, 80%, 100% { opacity: .3; } 40% { opacity: 1; } }
.caret::after { content: ""; display: inline-block; width: 7px; height: 15px; background: var(--ink); vertical-align: -2px; margin-left: 2px; animation: blink 1s infinite; }
.composer { border-top: 1px solid var(--line); padding: 14px 24px 16px; }
.composer .box { max-width: 760px; margin: 0 auto; border: 1px solid #d5d8dc; border-radius: 10px; padding: 8px 8px 8px 14px; display: flex; gap: 8px; align-items: flex-end; background: #fff; }
.composer .box:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.composer textarea { flex: 1; border: 0; outline: none; resize: none; font: 14.5px/1.5 var(--font); padding: 5px 0; max-height: 140px; color: var(--ink); }
.composer .hint { max-width: 760px; margin: 8px auto 0; font-size: 11.5px; color: var(--faint); display: flex; justify-content: space-between; }
.suggest { display: flex; flex-wrap: wrap; gap: 8px; }
.suggest button { border: 1px solid var(--line); background: #fff; border-radius: 6px; padding: 8px 12px; font: 13px var(--font); color: var(--ink-2); cursor: pointer; text-align: left; }
.suggest button:hover { border-color: #c4c9d0; background: #fafbfc; }
.suggest button .sd { display: block; font-size: 11.5px; color: var(--faint); margin-top: 1px; }
.chat-side { border-left: 1px solid var(--line); background: #fbfbfc; overflow-y: auto; }
.chat-side .cs-sec { padding: 16px; border-bottom: 1px solid var(--line-2); }
.excerpt { border: 1px solid var(--line); background: #fff; border-radius: 6px; padding: 12px; font-size: 13px; line-height: 1.55; }
.excerpt mark { background: #fff1c2; padding: 0 1px; }
.excerpt .ex-h { font-size: 12px; color: var(--muted); margin-bottom: 6px; display: flex; gap: 6px; align-items: center; }
.agent-row { display: flex; align-items: center; gap: 10px; padding: 7px 0; font-size: 13px; }
.agent-row .ag { width: 26px; height: 26px; border-radius: 6px; display: grid; place-items: center; background: #eef0f3; color: var(--ink-2); }
.agent-row.on .ag { background: var(--ink); color: #fff; }
.trace { font: 12px/1.7 var(--mono); color: var(--ink-2); }
.trace .ok { color: var(--good); }

/* ---------- Quiz ---------- */
.q-opt { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; padding: 12px 14px; border: 1px solid var(--line); border-radius: 8px; background: #fff; font: 14px var(--font); color: var(--ink); cursor: pointer; margin-top: 8px; }
.q-opt:hover { border-color: #c4c9d0; }
.q-opt .radio { width: 16px; height: 16px; border-radius: 50%; border: 1.5px solid #b9bec5; flex: none; }
.q-opt.sel { border-color: var(--accent); background: var(--accent-soft); }
.q-opt.sel .radio { border: 5px solid var(--accent); }
.q-opt.right { border-color: #9fd0b4; background: var(--good-soft); }
.q-opt.wrong { border-color: #efc4c0; background: var(--bad-soft); }

/* ---------- Login ---------- */
.auth { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); min-height: 100vh; background: #fff; }
.auth-l { padding: 40px 56px; display: flex; flex-direction: column; }
.auth-form { width: 100%; max-width: 380px; margin: auto; }
.auth-r { background: #15171b; color: #c9cdd3; padding: 56px; display: flex; flex-direction: column; justify-content: center; border-left: 1px solid #000; }
.auth-r h2 { color: #fff; font-size: 24px; line-height: 1.3; font-weight: 500; max-width: 440px; }
.divider { display: flex; align-items: center; gap: 12px; color: var(--faint); font-size: 12px; margin: 18px 0; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.demo-accts { margin-top: 24px; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.demo-accts .da-h { padding: 10px 14px; background: #fafbfb; border-bottom: 1px solid var(--line); font-size: 12.5px; display: flex; justify-content: space-between; }
.demo-accts button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 14px; border: 0; border-bottom: 1px solid var(--line-2); background: #fff; text-align: left; cursor: pointer; font: 13px var(--font); color: var(--ink); }
.demo-accts button:last-child { border-bottom: 0; }
.demo-accts button:hover { background: #f8f9fa; }
.err { color: var(--bad); font-size: 13px; margin-top: 10px; }

.menu-toggle { display: none !important; }

/* ---------- Responsive ---------- */
@media (max-width: 1200px) {
  .chat-shell { grid-template-columns: 220px minmax(0, 1fr); }
  .chat-side { display: none; }
}
@media (max-width: 1024px) {
  .g-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g-main, .g-3 { grid-template-columns: minmax(0, 1fr); }
  .search { display: none; }
}
@media (max-width: 860px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .side { position: fixed; left: 0; z-index: 70; width: 260px; transform: translateX(-100%); transition: transform .18s; }
  .side.open { transform: none; box-shadow: var(--shadow-lg); }
  .menu-toggle { display: grid !important; }
  .chat-shell { grid-template-columns: minmax(0, 1fr); }
  .chat-list { display: none; }
  .auth { grid-template-columns: minmax(0, 1fr); }
  .auth-r { display: none; }
  .auth-l { padding: 24px 16px; }
  .page { padding: 16px; }
  .top { padding: 0 16px; }
  .g-2 { grid-template-columns: minmax(0, 1fr); }
  .user-btn .un { display: none; }
  .crumbs { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
}
@media (max-width: 560px) {
  .g-4 { grid-template-columns: minmax(0, 1fr); }
  .page-h { flex-direction: column; align-items: flex-start; }
  .demo-bar .db-extra { display: none; }
  .cal { grid-template-columns: 40px repeat(5, minmax(0, 1fr)); font-size: 11px; }
}
