/* Learnyst Creator Studio — app design system. Builds on /styles.css brand tokens.
   Every class is prefixed cs- so nothing leaks into the marketing pages. */

:root {
  --cs-bg: #f6f8fa;
  --cs-card: #ffffff;
  --cs-line: #e5e7eb;
  --cs-line-2: #eef0f3;
  --cs-ink: #0a0a0a;
  --cs-ink-2: #374151;
  --cs-muted: #6b7280;
  --cs-faint: #9ca3af;
  --cs-green: #4fba58;
  --cs-green-d: #3c9646;
  --cs-green-bg: #f1feee;
  --cs-green-line: #cdeccd;
  --cs-teal: #093344;
  --cs-amber: #d97706;
  --cs-amber-bg: #fff7e6;
  --cs-red: #dc2626;
  --cs-red-bg: #fdecea;
  --cs-blue: #3086ff;
  --cs-side-w: 264px;
  --cs-head-h: 69px;
  --cs-radius: 14px;
  --cs-shadow: 0 1px 2px rgba(9,51,68,.05), 0 4px 14px rgba(9,51,68,.05);
}

body.cs-body { background: var(--cs-bg); overflow: hidden; }
/* Default icon size: inline icons follow the text. Zero-specificity so any component rule wins. */
:where(.cs-body) svg { width: 1.1em; height: 1.1em; vertical-align: -0.17em; flex: 0 0 auto; }
.cs-body .site-header { background: #fff; }
.cs-body .header-inner { max-width: none; padding: 0 18px; }

/* ---------------------------------------------------------------- shell */
.cs-app { display: grid; grid-template-columns: var(--cs-side-w) 1fr; height: calc(100dvh - var(--cs-head-h)); }
.cs-side { background: #fff; border-right: 1px solid var(--cs-line); display: flex; flex-direction: column; min-height: 0; }
.cs-side-scroll { flex: 1; overflow-y: auto; padding: 14px 12px 10px; }
.cs-new { display: flex; align-items: center; gap: 8px; width: 100%; padding: .62rem .8rem; border-radius: 11px;
  background: var(--cs-green); color: #052a12; font-weight: 800; font-size: .9rem; border: none; cursor: pointer;
  box-shadow: 0 4px 12px rgba(79,186,88,.28); }
.cs-new:hover { background: var(--green-600); }
.cs-nav-t { font-size: .7rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--cs-faint);
  padding: 16px 10px 6px; }
.cs-nav a { display: flex; align-items: center; gap: 10px; padding: .48rem .7rem; border-radius: 9px; color: var(--cs-ink-2);
  font-weight: 600; font-size: .88rem; line-height: 1.25; }
.cs-nav a svg { width: 17px; height: 17px; flex: 0 0 auto; color: var(--cs-muted); }
.cs-nav a:hover { background: var(--cs-bg); color: var(--cs-ink); }
.cs-nav a.on { background: var(--cs-green-bg); color: var(--cs-green-d); }
.cs-nav a.on svg { color: var(--cs-green-d); }
.cs-nav a .cs-tag { margin-left: auto; font-size: .64rem; font-weight: 800; color: var(--cs-green-d); background: var(--cs-green-bg);
  border: 1px solid var(--cs-green-line); padding: 1px 6px; border-radius: 999px; }
.cs-recents a { display: flex; align-items: center; gap: 8px; padding: .42rem .7rem; border-radius: 9px; color: var(--cs-ink-2);
  font-size: .84rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cs-recents a span { overflow: hidden; text-overflow: ellipsis; }
.cs-recents a:hover { background: var(--cs-bg); }
.cs-recents a.on { background: var(--cs-bg); color: var(--cs-ink); font-weight: 600; }
.cs-recents .cs-none { color: var(--cs-faint); font-size: .8rem; padding: 2px 10px; }
.cs-side-foot { border-top: 1px solid var(--cs-line); padding: 10px 12px; }
.cs-chchip { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 11px; cursor: pointer; border: 1px solid transparent; width: 100%; background: none; text-align: left; font: inherit; }
.cs-chchip:hover { background: var(--cs-bg); }
.cs-chchip img, .cs-chchip .ph { width: 34px; height: 34px; border-radius: 50%; flex: 0 0 auto; object-fit: cover; background: var(--cs-bg); display: flex; align-items: center; justify-content: center; color: var(--cs-muted); }
.cs-chchip .t { min-width: 0; line-height: 1.25; }
.cs-chchip .t b { display: block; font-size: .84rem; color: var(--cs-ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cs-chchip .t span { font-size: .74rem; color: var(--cs-muted); }
.cs-chchip.connect { border: 1.5px dashed var(--cs-line); }
.cs-chchip.connect:hover { border-color: var(--cs-green); }

.cs-main { overflow-y: auto; min-width: 0; position: relative; scroll-behavior: smooth; }
.cs-scrim { display: none; }
.cs-mobilebar { display: none; }
.cs-view { min-height: 100%; }
.cs-page { max-width: 1120px; margin: 0 auto; padding: 28px 28px 60px; }
.cs-page.narrow { max-width: 860px; }

@media (max-width: 900px) {
  body.cs-body { overflow: auto; }
  .cs-app { display: block; height: auto; }
  .cs-main { overflow: visible; }
  .cs-side { position: fixed; top: 0; left: 0; bottom: 0; width: min(84vw, 300px); z-index: 300; transform: translateX(-105%);
    transition: transform .2s ease; box-shadow: 0 0 40px rgba(0,0,0,.18); }
  .cs-side.open { transform: none; }
  .cs-scrim { position: fixed; inset: 0; background: rgba(9,51,68,.4); z-index: 290; }
  .cs-scrim.show { display: block; }
  .cs-mobilebar { display: flex; align-items: center; gap: 10px; position: sticky; top: var(--cs-head-h); z-index: 40;
    background: #fff; border-bottom: 1px solid var(--cs-line); padding: 8px 16px; }
  .cs-mobilebar button { background: none; border: 1px solid var(--cs-line); border-radius: 9px; padding: 6px 8px; cursor: pointer; display: flex; }
  .cs-mobilebar b { font-size: .92rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .cs-page { padding: 18px 16px 48px; }
}

/* ---------------------------------------------------------------- page head */
.cs-ph { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.cs-ph h1 { font-size: 1.55rem; font-weight: 800; letter-spacing: -.02em; color: var(--cs-ink); display: flex; align-items: center; gap: 10px; }
.cs-ph h1 svg { width: 24px; height: 24px; color: var(--cs-green-d); }
.cs-ph p { color: var(--cs-muted); margin: 6px 0 0; font-size: .95rem; max-width: 70ch; }
.cs-ph-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.cs-h2 { font-size: 1.08rem; font-weight: 800; color: var(--cs-ink); margin: 0 0 12px; display: flex; align-items: center; gap: 8px; }
.cs-h2 small { font-weight: 600; color: var(--cs-muted); font-size: .8rem; }
.cs-sub { color: var(--cs-muted); font-size: .86rem; }

/* ---------------------------------------------------------------- cards + grids */
.cs-card { background: var(--cs-card); border: 1px solid var(--cs-line); border-radius: var(--cs-radius); box-shadow: var(--cs-shadow); padding: 20px; }
.cs-card + .cs-card, .cs-stack > * + * { margin-top: 16px; }
.cs-card-h { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.cs-card-h h3 { font-size: 1rem; font-weight: 800; }
.cs-grid-2, .cs-grid-3, .cs-grid-4 { display: grid; gap: 14px; }
.cs-grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cs-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cs-grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 1000px) { .cs-grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .cs-grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .cs-grid-2, .cs-grid-3 { grid-template-columns: 1fr; } }
@media (max-width: 420px) { .cs-grid-4 { grid-template-columns: 1fr 1fr; gap: 10px; } }

.cs-stat { background: var(--cs-card); border: 1px solid var(--cs-line); border-radius: 12px; padding: 14px 16px; min-width: 0; }
.cs-stat .l { font-size: .74rem; font-weight: 700; color: var(--cs-muted); text-transform: uppercase; letter-spacing: .06em; display: flex; align-items: center; gap: 6px; }
.cs-stat .v { font-size: 1.55rem; font-weight: 800; color: var(--cs-ink); letter-spacing: -.02em; margin-top: 4px; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cs-stat .s { font-size: .78rem; color: var(--cs-muted); margin-top: 2px; }
.cs-stat.big .v { font-size: 2.1rem; }

/* ---------------------------------------------------------------- forms */
.cs-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.cs-field > label, .cs-label { font-size: .8rem; font-weight: 700; color: var(--cs-ink-2); }
.cs-field .hint { font-size: .76rem; color: var(--cs-muted); }
.cs-input, .cs-textarea, .cs-select { width: 100%; font-family: var(--font-body); font-size: .95rem; color: var(--cs-ink);
  padding: .68rem .8rem; border: 1.5px solid var(--cs-line); border-radius: 10px; background: #fff; transition: border .12s, box-shadow .12s; }
.cs-textarea { resize: vertical; min-height: 92px; line-height: 1.5; }
.cs-input:focus, .cs-textarea:focus, .cs-select:focus { outline: none; border-color: var(--cs-green); box-shadow: 0 0 0 4px rgba(79,186,88,.13); }
.cs-select { cursor: pointer; }
.cs-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.cs-row > .grow { flex: 1 1 220px; min-width: 0; }
.cs-search { display: flex; align-items: center; gap: 8px; background: #fff; border: 1.5px solid var(--cs-line); border-radius: 13px; padding: 6px 6px 6px 14px; box-shadow: var(--cs-shadow); }
.cs-search:focus-within { border-color: var(--cs-green); box-shadow: 0 0 0 4px rgba(79,186,88,.13); }
.cs-search > svg { width: 19px; height: 19px; color: var(--cs-muted); flex: 0 0 auto; }
.cs-search input { flex: 1; min-width: 0; border: none; outline: none; font: inherit; font-size: 1rem; padding: .55rem 0; background: transparent; }
.cs-search .btn { padding: .62rem 1.1rem; }
@media (max-width: 520px) { .cs-search { flex-wrap: wrap; padding: 8px; } .cs-search input { flex-basis: calc(100% - 40px); } .cs-search .btn { width: 100%; } }

.cs-seg { display: inline-flex; background: var(--cs-bg); border: 1px solid var(--cs-line); border-radius: 10px; padding: 3px; gap: 2px; flex-wrap: wrap; }
.cs-seg button { border: none; background: none; font: inherit; font-size: .84rem; font-weight: 700; color: var(--cs-muted); padding: .38rem .8rem; border-radius: 8px; cursor: pointer; }
.cs-seg button.on { background: #fff; color: var(--cs-ink); box-shadow: 0 1px 3px rgba(0,0,0,.08); }

.btn:disabled { opacity: .5; cursor: not-allowed; box-shadow: none; transform: none; }
.cs-btn-sm { padding: .42rem .75rem; font-size: .82rem; border-radius: 9px; }
.cs-icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 8px; border: 1px solid var(--cs-line); background: #fff; cursor: pointer; color: var(--cs-ink-2); }
.cs-icon-btn:hover { background: var(--cs-bg); }
.cs-icon-btn svg { width: 16px; height: 16px; }
.cs-link { color: var(--cs-green-d); font-weight: 700; cursor: pointer; background: none; border: none; font: inherit; padding: 0; }
.cs-link:hover { text-decoration: underline; }

/* ---------------------------------------------------------------- tabs */
.cs-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--cs-line); margin-bottom: 18px; overflow-x: auto; scrollbar-width: none; }
.cs-tabs a, .cs-tabs button { display: inline-flex; align-items: center; gap: 7px; padding: .7rem .9rem; font-weight: 700; font-size: .9rem; color: var(--cs-muted);
  border: none; background: none; border-bottom: 2.5px solid transparent; margin-bottom: -1px; cursor: pointer; white-space: nowrap; font-family: inherit; }
.cs-tabs a svg, .cs-tabs button svg { width: 16px; height: 16px; }
.cs-tabs .on { color: var(--cs-ink); border-bottom-color: var(--cs-green); }

/* ---------------------------------------------------------------- tables */
.cs-table-wrap { overflow-x: auto; border: 1px solid var(--cs-line); border-radius: 12px; background: #fff; }
.cs-table { width: 100%; border-collapse: collapse; font-size: .88rem; }
.cs-table th { text-align: left; font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--cs-muted); font-weight: 800;
  padding: 10px 14px; background: #fafbfc; border-bottom: 1px solid var(--cs-line); white-space: nowrap; }
.cs-table td { padding: 11px 14px; border-bottom: 1px solid var(--cs-line-2); vertical-align: middle; }
.cs-table tr:last-child td { border-bottom: none; }
.cs-table tbody tr:hover { background: #fafbfc; }
.cs-table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.cs-table th.sortable { cursor: pointer; user-select: none; }
.cs-table th.sortable:hover { color: var(--cs-ink); }

/* ---------------------------------------------------------------- badges, scores */
.cs-badge { display: inline-flex; align-items: center; gap: 4px; font-size: .72rem; font-weight: 800; padding: 2px 8px; border-radius: 999px; white-space: nowrap;
  background: var(--cs-bg); color: var(--cs-ink-2); border: 1px solid var(--cs-line); }
.cs-badge.good { background: var(--cs-green-bg); color: var(--cs-green-d); border-color: var(--cs-green-line); }
.cs-badge.warn { background: var(--cs-amber-bg); color: #b45309; border-color: #fde3b0; }
.cs-badge.bad { background: var(--cs-red-bg); color: #b42318; border-color: #f8c9c3; }
.cs-badge.dark { background: var(--cs-teal); color: #fff; border-color: var(--cs-teal); }
.cs-badge.blue { background: #eaf2ff; color: #1d5fd1; border-color: #c9dcff; }
.cs-mult { display: inline-flex; align-items: center; font-size: .74rem; font-weight: 800; padding: 2px 7px; border-radius: 6px; background: var(--cs-teal); color: #fff; font-variant-numeric: tabular-nums; }
.cs-mult.hot { background: #e11d48; }
.cs-mult.good { background: var(--cs-green-d); }
.cs-mult.low { background: #9ca3af; }

.cs-ring { --p: 50; --c: var(--cs-green); --sz: 84px; width: var(--sz); height: var(--sz); border-radius: 50%; flex: 0 0 auto;
  background: conic-gradient(var(--c) calc(var(--p) * 1%), #e9edf1 0); display: grid; place-items: center; }
.cs-ring::before { content: ""; grid-area: 1/1; width: calc(var(--sz) - 14px); height: calc(var(--sz) - 14px); border-radius: 50%; background: #fff; }
.cs-ring b { grid-area: 1/1; position: relative; font-size: calc(var(--sz) * .3); font-weight: 800; color: var(--cs-ink); font-variant-numeric: tabular-nums; }
.cs-bar { height: 8px; border-radius: 999px; background: #e9edf1; overflow: hidden; }
.cs-bar i { display: block; height: 100%; border-radius: 999px; background: var(--cs-green); }
.cs-meter { display: flex; flex-direction: column; gap: 6px; }
.cs-meter .top { display: flex; justify-content: space-between; font-size: .84rem; font-weight: 700; color: var(--cs-ink-2); }

/* ---------------------------------------------------------------- videos + channels */
.cs-vgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(232px, 1fr)); gap: 16px; }
.cs-vcard { display: flex; flex-direction: column; gap: 8px; min-width: 0; color: inherit; }
.cs-vthumb { position: relative; aspect-ratio: 16/9; border-radius: 11px; overflow: hidden; background: #e9edf1; display: block; }
.cs-vthumb img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .2s; }
.cs-vcard:hover .cs-vthumb img { transform: scale(1.03); }
.cs-vthumb .dur { position: absolute; right: 6px; bottom: 6px; background: rgba(0,0,0,.8); color: #fff; font-size: .7rem; font-weight: 700; padding: 1px 5px; border-radius: 4px; }
.cs-vthumb .tl { position: absolute; left: 6px; top: 6px; display: flex; gap: 4px; }
.cs-vtitle { font-weight: 700; font-size: .9rem; line-height: 1.32; color: var(--cs-ink); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.cs-vmeta { font-size: .78rem; color: var(--cs-muted); line-height: 1.4; }
.cs-vmeta b { color: var(--cs-ink-2); font-weight: 700; }
.cs-vrow { display: flex; gap: 12px; align-items: center; min-width: 0; }
.cs-vrow .cs-vthumb { width: 132px; flex: 0 0 auto; border-radius: 8px; }
.cs-vrow .t { min-width: 0; }

.cs-chrow { display: flex; align-items: center; gap: 12px; min-width: 0; }
.cs-chrow img, .cs-av { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; flex: 0 0 auto; background: var(--cs-bg); }
.cs-chrow .t { min-width: 0; line-height: 1.3; }
.cs-chrow .t b { display: block; font-size: .95rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cs-chrow .t span { font-size: .8rem; color: var(--cs-muted); }

/* ---------------------------------------------------------------- states */
.cs-empty { text-align: center; padding: 44px 20px; color: var(--cs-muted); }
.cs-empty .ic { width: 52px; height: 52px; border-radius: 14px; background: var(--cs-green-bg); color: var(--cs-green-d); display: inline-flex; align-items: center; justify-content: center; margin-bottom: 12px; }
.cs-empty .ic svg { width: 24px; height: 24px; }
.cs-empty h3 { color: var(--cs-ink); font-size: 1.08rem; margin-bottom: 6px; }
.cs-empty p { margin: 0 auto 16px; max-width: 46ch; font-size: .92rem; }
.cs-loading { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 40px 16px; color: var(--cs-muted); text-align: center; font-size: .92rem; }
.cs-spin { width: 34px; height: 34px; border-radius: 50%; border: 3.5px solid #e5e7eb; border-top-color: var(--cs-green); animation: csspin .9s linear infinite; }
.cs-spin.sm { width: 16px; height: 16px; border-width: 2px; display: inline-block; vertical-align: -3px; }
@keyframes csspin { to { transform: rotate(360deg); } }
.cs-skel { border-radius: 10px; background: linear-gradient(90deg, #eef1f4 25%, #e3e7eb 37%, #eef1f4 63%); background-size: 400% 100%; animation: shimmer 1.2s ease infinite; }
.cs-error { background: var(--cs-red-bg); border: 1px solid #f5c6c0; color: #b3251a; border-radius: 11px; padding: 11px 14px; font-size: .9rem; font-weight: 600; }
.cs-note { background: #f8fafc; border: 1px solid var(--cs-line); border-radius: 11px; padding: 11px 14px; font-size: .86rem; color: var(--cs-ink-2); }
.cs-note.green { background: var(--cs-green-bg); border-color: var(--cs-green-line); }
.cs-cost { display: inline-flex; align-items: center; gap: 5px; font-size: .74rem; font-weight: 700; color: var(--cs-muted); white-space: nowrap; }
.cs-cost svg { width: 13px; height: 13px; }
.cs-cost.paid { color: var(--cs-green-d); }

.cs-toasts { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); z-index: 2000; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.cs-toast { background: var(--cs-teal); color: #fff; font-size: .88rem; font-weight: 600; padding: .65rem 1rem; border-radius: 10px; box-shadow: 0 10px 30px rgba(0,0,0,.2); animation: rise .25s ease both; max-width: 92vw; }
.cs-toast.bad { background: #b42318; }
.cs-toast.good { background: var(--cs-green-d); }

/* ---------------------------------------------------------------- lists of generated text */
.cs-list { display: flex; flex-direction: column; gap: 10px; }
.cs-li { display: flex; align-items: flex-start; gap: 12px; background: #fff; border: 1px solid var(--cs-line); border-radius: 12px; padding: 13px 14px; animation: rise .3s ease both; }
.cs-li:hover { border-color: #cfd6dd; }
.cs-li .body { flex: 1; min-width: 0; }
.cs-li .main { font-weight: 700; color: var(--cs-ink); font-size: .96rem; line-height: 1.4; word-wrap: break-word; }
.cs-li .why { font-size: .82rem; color: var(--cs-muted); margin-top: 3px; line-height: 1.45; }
.cs-li .side { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.cs-copy { font-size: .78rem; font-weight: 700; font-family: inherit; color: var(--cs-ink-2); background: var(--cs-bg); border: 1px solid var(--cs-line); border-radius: 8px; padding: .36rem .62rem; cursor: pointer; white-space: nowrap; display: inline-flex; gap: 5px; align-items: center; }
.cs-copy svg { width: 13px; height: 13px; }
.cs-copy:hover { border-color: var(--cs-green); color: var(--cs-green-d); }
.cs-copy.done { background: var(--cs-green); border-color: var(--cs-green); color: #052a12; }
.cs-pre { white-space: pre-wrap; word-wrap: break-word; font-family: inherit; font-size: .92rem; line-height: 1.6; background: #fafbfc; border: 1px solid var(--cs-line); border-radius: 11px; padding: 14px 16px; margin: 0; color: var(--cs-ink); }
.cs-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.cs-tags span { background: var(--cs-bg); border: 1px solid var(--cs-line); border-radius: 999px; padding: 3px 10px; font-size: .8rem; font-weight: 600; color: var(--cs-ink-2); }

/* ---------------------------------------------------------------- markdown */
.cs-md { font-size: .95rem; line-height: 1.65; color: var(--cs-ink); word-wrap: break-word; }
.cs-md > *:first-child { margin-top: 0; }
.cs-md > *:last-child { margin-bottom: 0; }
.cs-md p { margin: 0 0 .75em; }
.cs-md h1, .cs-md h2, .cs-md h3, .cs-md h4 { margin: 1.1em 0 .45em; letter-spacing: -.01em; line-height: 1.3; }
.cs-md h1 { font-size: 1.25rem; } .cs-md h2 { font-size: 1.12rem; } .cs-md h3 { font-size: 1rem; } .cs-md h4 { font-size: .95rem; }
.cs-md ul, .cs-md ol { margin: 0 0 .8em; padding-left: 1.35em; }
.cs-md li { margin: .22em 0; }
.cs-md li > ul, .cs-md li > ol { margin: .2em 0; }
.cs-md strong { font-weight: 750; }
.cs-md code { background: #f1f3f5; border-radius: 5px; padding: 1px 5px; font-size: .86em; font-family: ui-monospace, Menlo, monospace; }
.cs-md pre { background: #0f1720; color: #e6edf3; border-radius: 10px; padding: 12px 14px; overflow-x: auto; }
.cs-md pre code { background: none; padding: 0; color: inherit; }
.cs-md blockquote { margin: 0 0 .8em; border-left: 3px solid var(--cs-green); padding: 2px 0 2px 12px; color: var(--cs-ink-2); }
.cs-md a { color: var(--cs-green-d); font-weight: 600; text-decoration: underline; }
.cs-md hr { border: none; border-top: 1px solid var(--cs-line); margin: 1em 0; }
.cs-md table { border-collapse: collapse; margin: 0 0 .9em; font-size: .88rem; display: block; overflow-x: auto; max-width: 100%; }
.cs-md th, .cs-md td { border: 1px solid var(--cs-line); padding: 6px 10px; text-align: left; vertical-align: top; }
.cs-md th { background: #fafbfc; font-weight: 750; }

/* ---------------------------------------------------------------- chat */
.cs-chat { display: flex; flex-direction: column; min-height: 100%; }
.cs-msgs { flex: 1; width: 100%; max-width: 820px; margin: 0 auto; padding: 26px 22px 12px; }
.cs-msg { margin-bottom: 22px; animation: rise .25s ease both; }
.cs-msg.user { display: flex; justify-content: flex-end; }
.cs-msg.user .bub { background: var(--cs-teal); color: #fff; border-radius: 16px 16px 4px 16px; padding: 10px 14px; max-width: 80%; white-space: pre-wrap; word-wrap: break-word; font-size: .95rem; line-height: 1.5; }
.cs-msg.ai { display: flex; gap: 12px; }
.cs-msg.ai .av { width: 30px; height: 30px; border-radius: 9px; background: var(--cs-green-bg); border: 1px solid var(--cs-green-line); color: var(--cs-green-d); display: flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.cs-msg.ai .av svg { width: 16px; height: 16px; }
.cs-msg.ai .content { flex: 1; min-width: 0; padding-top: 3px; }
.cs-msg .acts { display: flex; gap: 6px; margin-top: 8px; opacity: .85; }
.cs-steps { display: flex; flex-direction: column; gap: 4px; margin-bottom: 8px; }
.cs-step { display: inline-flex; align-items: center; gap: 7px; font-size: .8rem; color: var(--cs-muted); font-weight: 600; }
.cs-step svg { width: 14px; height: 14px; color: var(--cs-green-d); }
.cs-sources { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; margin-top: 12px; }
.cs-sources .cs-vtitle { font-size: .8rem; }
.cs-caret::after { content: "▍"; animation: csblink 1s steps(2) infinite; color: var(--cs-green); margin-left: 1px; }
@keyframes csblink { 50% { opacity: 0; } }

.cs-composer-wrap { position: sticky; bottom: 0; background: linear-gradient(180deg, rgba(246,248,250,0), var(--cs-bg) 30%); padding: 14px 22px 18px; }
.cs-composer { max-width: 820px; margin: 0 auto; background: #fff; border: 1.5px solid var(--cs-line); border-radius: 18px; box-shadow: 0 8px 28px rgba(9,51,68,.08); padding: 12px 12px 10px 16px; }
.cs-composer:focus-within { border-color: var(--cs-green); }
.cs-composer textarea { width: 100%; border: none; outline: none; resize: none; font: inherit; font-size: .98rem; line-height: 1.5; max-height: 220px; min-height: 26px; background: transparent; padding: 4px 0; }
.cs-composer .bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 6px; }
.cs-composer .left { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.cs-send { width: 38px; height: 38px; border-radius: 11px; border: none; background: var(--cs-green); color: #052a12; cursor: pointer; display: flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.cs-send:disabled { background: #e5e7eb; color: #9ca3af; cursor: not-allowed; }
.cs-send svg { width: 18px; height: 18px; }
.cs-mode { display: inline-flex; align-items: center; gap: 6px; font-size: .8rem; font-weight: 700; color: var(--cs-ink-2); background: var(--cs-bg); border: 1px solid var(--cs-line); border-radius: 999px; padding: .3rem .7rem; cursor: pointer; font-family: inherit; }
.cs-mode svg { width: 14px; height: 14px; }
.cs-mode.on { background: #eef4ff; border-color: #c9dcff; color: #1d5fd1; }
.cs-chctx { display: inline-flex; align-items: center; gap: 6px; font-size: .78rem; color: var(--cs-muted); font-weight: 600; }
.cs-chctx img { width: 18px; height: 18px; border-radius: 50%; }

.cs-welcome { width: 100%; max-width: 820px; margin: 0 auto; padding: 8vh 22px 10px; text-align: center; }
.cs-welcome h2 { font-size: clamp(1.6rem, 3.4vw, 2.15rem); font-weight: 800; letter-spacing: -.025em; }
.cs-welcome > p { color: var(--cs-muted); margin: 10px auto 22px; max-width: 56ch; }
.cs-connect-banner > span { display: flex; align-items: center; gap: 9px; }
.cs-connect-banner > span svg { width: 20px; height: 20px; color: #e11d48; }
.cs-connect-banner { display: flex; align-items: center; justify-content: space-between; gap: 12px; background: #fff; border: 1px solid var(--cs-line); border-radius: 14px; padding: 10px 10px 10px 16px; margin: 0 auto 14px; max-width: 820px; text-align: left; font-size: .9rem; font-weight: 600; }
.cs-quick { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 16px; }
.cs-quick button { display: inline-flex; align-items: center; gap: 7px; font: inherit; font-size: .86rem; font-weight: 600; color: var(--cs-ink-2); background: #fff; border: 1px solid var(--cs-line); border-radius: 999px; padding: .45rem .85rem; cursor: pointer; }
.cs-quick button svg { width: 15px; height: 15px; color: var(--cs-green-d); }
.cs-quick button:hover { border-color: var(--cs-green); color: var(--cs-ink); }
.cs-tools { width: 100%; display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; margin: 34px auto 0; max-width: 1000px; padding: 0 22px; text-align: left; }
.cs-tool { display: flex; gap: 12px; align-items: flex-start; background: #fff; border: 1px solid var(--cs-line); border-radius: 14px; padding: 14px; transition: border .12s, transform .12s; }
.cs-tool:hover { border-color: var(--cs-green); transform: translateY(-2px); }
.cs-tool .ic { width: 36px; height: 36px; border-radius: 10px; background: var(--cs-green-bg); color: var(--cs-green-d); display: flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.cs-tool .ic svg { width: 18px; height: 18px; }
.cs-tool b { display: block; font-size: .92rem; }
.cs-tool span { font-size: .8rem; color: var(--cs-muted); line-height: 1.4; display: block; margin-top: 2px; }

/* ---------------------------------------------------------------- charts (inline svg) */
.cs-chart { width: 100%; height: 160px; display: block; }
.cs-chart .bar { fill: #cfe9d2; } .cs-chart .bar.hi { fill: var(--cs-green); } .cs-chart .bar.short { fill: #c9dcff; }
.cs-chart .axis { stroke: #e5e7eb; } .cs-chart text { font-size: 10px; fill: #9ca3af; font-family: var(--font-body); }

/* ---------------------------------------------------------------- SEO section */
.cs-seo { background: #fff; border-top: 1px solid var(--cs-line); margin-top: 40px; }
.cs-seo[hidden] { display: none; }
.cs-seo-in { max-width: 900px; margin: 0 auto; padding: 48px 28px 40px; }
.cs-seo h1 { font-size: clamp(1.5rem, 3vw, 2rem); margin-bottom: 12px; }
.cs-seo h2 { font-size: 1.25rem; margin: 28px 0 10px; }
.cs-seo p, .cs-seo li { color: var(--cs-ink-2); font-size: .97rem; }
.cs-seo ul { padding-left: 1.2em; }
.cs-seo .foot { margin-top: 36px; padding-top: 18px; border-top: 1px solid var(--cs-line); font-size: .82rem; color: var(--cs-muted); display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.cs-seo .foot a { color: var(--cs-muted); } .cs-seo .foot a:hover { color: var(--cs-green-d); }

/* ---------------------------------------------------------------- misc */
.cs-hide { display: none !important; }
.cs-mt { margin-top: 16px; } .cs-mt2 { margin-top: 26px; } .cs-mb { margin-bottom: 16px; }
.cs-flex { display: flex; align-items: center; gap: 10px; }
.cs-between { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.cs-muted { color: var(--cs-muted); }
.cs-small { font-size: .82rem; }
.cs-num { font-variant-numeric: tabular-nums; }
.cs-clamp2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.cs-sticky-actions { position: sticky; bottom: 0; background: linear-gradient(180deg, rgba(246,248,250,0), var(--cs-bg) 40%); padding-top: 12px; }
.cs-upload { border: 2px dashed #d1d5db; border-radius: 14px; background: #fafbfc; padding: 26px 16px; text-align: center; cursor: pointer; transition: .15s; color: var(--cs-muted); font-size: .9rem; }
.cs-upload:hover, .cs-upload.drag { border-color: var(--cs-green); background: var(--cs-green-bg); }
.cs-upload svg { width: 26px; height: 26px; color: var(--cs-green-d); }
.cs-upload b { display: block; color: var(--cs-ink); margin: 6px 0 2px; }

/* ---------------------------------------------------------------- legal */
.cs-side-legal { font-size: .7rem; color: var(--cs-faint); padding: 8px 8px 0; line-height: 1.5; }
.cs-side-legal a { color: var(--cs-muted); text-decoration: underline; }
.cs-legal h2 { font-size: 1.05rem; margin-top: 1.4em; }

/* ---------------------------------------------------------------- integration fixes */
/* Cards side by side in a grid must line up (the stacked-card gap is for vertical stacks only). */
.cs-grid-2 > .cs-card, .cs-grid-3 > .cs-card, .cs-grid-4 > .cs-card { margin-top: 0; }
/* <button class="btn"> and <a class="btn"> must be the same height. */
.cs-body .btn { line-height: inherit; }
/* Desktop: the chat fills the screen so the composer sits at the bottom even in short chats. */
@media (min-width: 901px) { .cs-chat { min-height: calc(100dvh - var(--cs-head-h)); } }
/* Phones: two sticky bars sit on top, so scrolled-to headings must clear them. */
@media (max-width: 900px) { html { scroll-padding-top: calc(var(--cs-head-h) + 58px); } }
