/* Growth Studio — light, neutral, professional. */
:root {
  --bg: #F6F7F9;
  --surface: #FFFFFF;
  --surface-2: #FAFBFC;
  --border: #E5E8EC;
  --border-strong: #D3D8DF;
  --text: #101828;
  --text-2: #475467;
  --muted: #7A8597;
  --accent: #1D4ED8;
  --accent-hover: #1E40AF;
  --accent-weak: #EEF3FE;
  --accent-ring: rgba(29, 78, 216, .16);
  --good: #0F7B55;
  --good-bg: #E9F6F0;
  --warn: #A35A00;
  --warn-bg: #FFF5E6;
  --bad: #C0362C;
  --bad-bg: #FDEEEC;
  --neutral-bg: #F1F3F6;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .05);
  --shadow-md: 0 4px 12px rgba(16, 24, 40, .08), 0 1px 3px rgba(16, 24, 40, .06);
  --shadow-lg: 0 16px 40px rgba(16, 24, 40, .14), 0 2px 6px rgba(16, 24, 40, .06);
  --sidebar: 248px;
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
/* slim, quiet scrollbars everywhere (no chunky OS scrollbars) */
* { scrollbar-width: thin; scrollbar-color: #D3D8DF transparent; }
*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb { background: #D9DDE3; border-radius: 8px; border: 2px solid transparent; background-clip: padding-box; }
*::-webkit-scrollbar-thumb:hover { background: #BCC3CD; background-clip: padding-box; border: 2px solid transparent; }
*::-webkit-scrollbar-button { display: none; width: 0; height: 0; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "cv11", "ss01", "ss03";
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -0.011em; }
.num, .tabular { font-variant-numeric: tabular-nums; }
svg.i { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
svg.i.sm { width: 15px; height: 15px; }
svg.i.lg { width: 22px; height: 22px; }

/* ---------- layout ---------- */
.app { display: flex; min-height: 100vh; }
.sidebar {
  width: var(--sidebar); flex: none; background: var(--surface); border-right: 1px solid var(--border);
  position: fixed; inset: 0 auto 0 0; display: flex; flex-direction: column; z-index: 20;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 20px 20px 16px; }
.brand-mark { width: 30px; height: 30px; border-radius: 8px; background: var(--text); color: #fff; display: grid; place-items: center; }
.brand-mark svg { width: 17px; height: 17px; stroke-width: 2.2; }
.brand-name { font-weight: 650; font-size: 15px; letter-spacing: -0.01em; }
.brand-sub { font-size: 12px; color: var(--muted); margin-top: -2px; }
.nav { padding: 6px 10px; flex: 1; overflow-y: auto; scrollbar-width: none; -ms-overflow-style: none; }
.nav::-webkit-scrollbar { display: none; width: 0; height: 0; }
.nav-label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 12px 10px 5px; }
.nav a {
  display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: var(--radius-sm);
  color: var(--text-2); font-weight: 500; margin-bottom: 1px; text-decoration: none;
}
.nav a:hover { background: var(--neutral-bg); color: var(--text); }
.nav a.active { background: var(--accent-weak); color: var(--accent); }
.nav a .count { margin-left: auto; font-size: 11px; font-weight: 600; background: var(--bad); color: #fff; border-radius: 10px; padding: 1px 7px; }
.sidebar-foot { padding: 14px 16px; border-top: 1px solid var(--border); font-size: 12px; color: var(--muted); }
.sidebar-foot .row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }

.main { margin-left: var(--sidebar); flex: 1; min-width: 0; }
.topbar {
  position: sticky; top: 0; z-index: 10; background: rgba(246, 247, 249, .9); backdrop-filter: blur(8px);
  border-bottom: 1px solid transparent; padding: 18px 32px 14px; display: flex; align-items: center; gap: 16px;
}
.topbar.scrolled { border-bottom-color: var(--border); }
.page-title { font-size: 20px; font-weight: 650; }
.page-sub { color: var(--muted); font-size: 13px; margin-top: 2px; }
.topbar .spacer { flex: 1; }
.content { padding: 8px 32px 48px; max-width: 1280px; }

/* ---------- surfaces ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.card-h { display: flex; align-items: center; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.card-h h3 { font-size: 15px; }
.card-h .sub { color: var(--muted); font-size: 12.5px; font-weight: 400; margin-top: 2px; }
.card-h .right { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.card-b { padding: 20px; }
.card-b.tight { padding: 0; }
.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)); }
.g-side { grid-template-columns: minmax(0, 1fr) 360px; }
.g-form { grid-template-columns: 420px minmax(0, 1fr); align-items: start; }
.stack > * + * { margin-top: 16px; }
.row { display: flex; align-items: center; gap: 10px; }
.row.wrap { flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.muted { color: var(--muted); }
.text-2 { color: var(--text-2); }
.small { font-size: 12.5px; }
.tiny { font-size: 11.5px; }
.bold { font-weight: 600; }
.mt-4 { margin-top: 4px; } .mt-8 { margin-top: 8px; } .mt-12 { margin-top: 12px; } .mt-16 { margin-top: 16px; } .mt-24 { margin-top: 24px; }
.divider { height: 1px; background: var(--border); margin: 16px 0; }
.section-title { font-size: 13px; font-weight: 600; color: var(--text-2); margin-bottom: 10px; }

/* ---------- KPI ---------- */
.kpi { padding: 18px 20px; }
.kpi .label { color: var(--muted); font-size: 12.5px; font-weight: 500; display: flex; align-items: center; gap: 6px; }
.kpi .value { font-size: 26px; font-weight: 650; letter-spacing: -0.02em; margin-top: 6px; font-variant-numeric: tabular-nums; }
.kpi .delta { font-size: 12.5px; font-weight: 600; margin-top: 4px; }
.delta.up { color: var(--good); } .delta.down { color: var(--bad); } .delta.flat { color: var(--muted); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 36px; padding: 0 14px;
  border-radius: var(--radius-sm); border: 1px solid var(--border-strong); background: var(--surface);
  color: var(--text); font: inherit; font-weight: 550; cursor: pointer; white-space: nowrap;
  transition: background .12s, border-color .12s, box-shadow .12s, color .12s; box-shadow: var(--shadow-sm);
}
.btn:hover { background: var(--surface-2); border-color: #C4CAD3; }
.btn:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--accent-ring); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn.danger { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn.danger:hover { background: #A52E25; }
.btn.ghost { border-color: transparent; background: transparent; box-shadow: none; color: var(--text-2); }
.btn.ghost:hover { background: var(--neutral-bg); color: var(--text); }
.btn.sm { height: 30px; padding: 0 10px; font-size: 13px; }
.btn.icon { width: 34px; padding: 0; }
.btn.sm.icon { width: 30px; }
.btn .spin { width: 14px; height: 14px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- forms ---------- */
.field { display: block; }
.field + .field { margin-top: 14px; }
.field > .lbl { display: flex; justify-content: space-between; font-size: 13px; font-weight: 550; color: var(--text); margin-bottom: 6px; }
.field > .lbl .hint { font-weight: 400; color: var(--muted); }
.field .help { font-size: 12px; color: var(--muted); margin-top: 5px; }
.input, textarea.input {
  width: 100%; height: 38px; padding: 0 12px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  font: inherit; color: var(--text); background: var(--surface); transition: border-color .12s, box-shadow .12s;
}
textarea.input { height: auto; min-height: 88px; padding: 10px 12px; resize: vertical; line-height: 1.5; }
.input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring); }
.input::placeholder { color: #A0A8B5; }
.input-group { display: flex; gap: 8px; }
.input-group .input { flex: 1; }

/* switch */
.switch { position: relative; display: inline-block; vertical-align: middle; width: 38px; height: 22px; flex: none; cursor: pointer; }
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch .track { position: absolute; inset: 0; background: #CBD2DC; border-radius: 22px; transition: background .15s; }
.switch .track::after { content: ""; position: absolute; width: 18px; height: 18px; left: 2px; top: 2px; background: #fff; border-radius: 50%; box-shadow: 0 1px 2px rgba(0,0,0,.2); transition: transform .15s; }
.switch input:checked + .track { background: var(--accent); }
.switch input:checked + .track::after { transform: translateX(16px); }
.switch input:focus-visible + .track { box-shadow: 0 0 0 3px var(--accent-ring); }

/* segmented */
.seg { display: inline-flex; background: var(--neutral-bg); border-radius: var(--radius-sm); padding: 3px; gap: 2px; }
.seg button { border: 0; background: transparent; font: inherit; font-weight: 550; color: var(--text-2); padding: 5px 12px; border-radius: 6px; cursor: pointer; font-size: 13px; }
.seg button.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }

/* tabs */
.tabs { display: flex; gap: 22px; border-bottom: 1px solid var(--border); margin-bottom: 16px; }
.tabs button { border: 0; background: none; font: inherit; font-weight: 550; color: var(--muted); padding: 10px 0; cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs button.on { color: var(--text); border-bottom-color: var(--text); }
.tabs button .count { margin-left: 6px; font-size: 11px; background: var(--neutral-bg); padding: 1px 7px; border-radius: 10px; color: var(--text-2); }

/* custom select */
.select { position: relative; }
.select-btn {
  width: 100%; height: 38px; display: flex; align-items: center; gap: 8px; padding: 0 10px 0 12px;
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--surface);
  font: inherit; color: var(--text); cursor: pointer; text-align: left; box-shadow: var(--shadow-sm);
}
.select-btn:focus-visible, .select.open .select-btn { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring); }
.select-btn .val { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.select-btn .ph { color: #A0A8B5; }
.select-btn svg { color: var(--muted); transition: transform .15s; }
.select.open .select-btn svg.chev { transform: rotate(180deg); }
.popover {
  position: fixed; z-index: 100; background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
  box-shadow: var(--shadow-lg); padding: 6px; max-height: 340px; overflow: auto; min-width: 200px;
  animation: pop .12s ease-out;
}
@keyframes pop { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.popover .search { position: sticky; top: -6px; background: var(--surface); padding: 4px 2px 6px; margin: -6px -6px 4px; padding: 8px 8px 6px; border-bottom: 1px solid var(--border); }
.popover .search input { width: 100%; height: 32px; border: 1px solid var(--border-strong); border-radius: 6px; padding: 0 10px; font: inherit; }
.popover .search input:focus { outline: none; border-color: var(--accent); }
.opt { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 6px; cursor: pointer; color: var(--text); }
.opt:hover, .opt.hl { background: var(--neutral-bg); }
.opt.sel { color: var(--accent); font-weight: 550; }
.opt .check { margin-left: auto; color: var(--accent); }
.opt .meta { font-size: 12px; color: var(--muted); }
.opt-thumb { width: 56px; height: 32px; border-radius: 4px; object-fit: cover; background: var(--neutral-bg); flex: none; }
.opt-empty { padding: 14px; color: var(--muted); text-align: center; font-size: 13px; }

/* ---------- badges / pills ---------- */
.badge { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px; border-radius: 6px; font-size: 12px; font-weight: 600; background: var(--neutral-bg); color: var(--text-2); white-space: nowrap; }
.badge.good { background: var(--good-bg); color: var(--good); }
.badge.warn { background: var(--warn-bg); color: var(--warn); }
.badge.bad { background: var(--bad-bg); color: var(--bad); }
.badge.accent { background: var(--accent-weak); color: var(--accent); }
.badge .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; border-radius: 30px; border: 1px solid var(--border); background: var(--surface); font-size: 12.5px; font-weight: 550; color: var(--text-2); }
.pill .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--good); }
.pill.warn .dot { background: #E69100; }
.pill.off .dot { background: #B5BDC9; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 6px; background: var(--neutral-bg); font-size: 12.5px; color: var(--text-2); margin: 0 6px 6px 0; }
.chip button { border: 0; background: none; padding: 0; cursor: pointer; color: var(--muted); display: inline-flex; }
.chip button:hover { color: var(--bad); }

/* ---------- tables ---------- */
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: 12px; font-weight: 600; color: var(--muted); padding: 10px 16px; border-bottom: 1px solid var(--border); background: var(--surface-2); white-space: nowrap; }
.table td { padding: 12px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tr.click { cursor: pointer; }
.table tr.click:hover td { background: var(--surface-2); }
.table .r { text-align: right; }
.vid { display: flex; align-items: center; gap: 12px; min-width: 0; }
.vid img { width: 88px; height: 50px; object-fit: cover; border-radius: 6px; background: var(--neutral-bg); flex: none; }
.vid .t { font-weight: 550; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }

/* ---------- index / meters ---------- */
.idx { font-weight: 650; font-variant-numeric: tabular-nums; }
.meter { height: 6px; background: var(--neutral-bg); border-radius: 6px; overflow: hidden; }
.meter > span { display: block; height: 100%; background: var(--accent); border-radius: 6px; }
.bar-row { display: grid; grid-template-columns: 180px 1fr 52px; gap: 12px; align-items: center; padding: 6px 0; font-size: 13px; }
.bar-row .meter { height: 8px; }

/* ---------- verdict hero ---------- */
.hero { display: flex; gap: 24px; align-items: center; padding: 22px 24px; }
.hero .big { font-size: 44px; font-weight: 700; letter-spacing: -0.03em; line-height: 1; font-variant-numeric: tabular-nums; }
.hero .big small { font-size: 18px; color: var(--muted); font-weight: 600; margin-left: 2px; }
.hero .divv { width: 1px; align-self: stretch; background: var(--border); }
.hero h2 { font-size: 18px; }

/* metric tiles */
.tile { border: 1px solid var(--border); border-radius: 10px; padding: 14px 16px; background: var(--surface); }
.tile .label { font-size: 12px; color: var(--muted); font-weight: 500; }
.tile .value { font-size: 20px; font-weight: 650; margin-top: 4px; font-variant-numeric: tabular-nums; }
.tile .cmp { font-size: 12px; margin-top: 2px; color: var(--muted); }

/* factor list */
.factor { padding: 14px 0; border-bottom: 1px solid var(--border); }
.factor:last-child { border-bottom: 0; padding-bottom: 0; }
.factor:first-child { padding-top: 0; }
.factor .head { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.factor .ev { color: var(--text-2); margin-top: 4px; }
.factor .fix { margin-top: 8px; padding: 10px 12px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; font-size: 13px; }
.factor .fix b { color: var(--text); }

/* score ring */
.ring { position: relative; width: 132px; height: 132px; flex: none; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring .lbl { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; }
.ring .lbl b { font-size: 34px; font-weight: 700; letter-spacing: -0.02em; display: block; line-height: 1; }
.ring .lbl span { font-size: 11.5px; color: var(--muted); }

/* range bar for forecasts */
.range { position: relative; height: 10px; background: var(--neutral-bg); border-radius: 10px; margin: 26px 0 26px; }
.range .fill { position: absolute; top: 0; bottom: 0; background: #C9D7FA; border-radius: 10px; }
.range .mark { position: absolute; top: -5px; width: 3px; height: 20px; background: var(--accent); border-radius: 2px; }
.range .tag { position: absolute; font-size: 12px; transform: translateX(-50%); white-space: nowrap; }
.range .tag.top { top: -24px; font-weight: 650; color: var(--accent); }
.range .tag.bot { top: 16px; color: var(--muted); }

/* ---------- empty / skeleton ---------- */
.empty { text-align: center; padding: 48px 24px; }
.empty .ic { width: 44px; height: 44px; border-radius: 12px; background: var(--neutral-bg); display: grid; place-items: center; margin: 0 auto 14px; color: var(--text-2); }
.empty h3 { font-size: 15px; }
.empty p { color: var(--muted); max-width: 440px; margin: 6px auto 16px; }
.skel { background: linear-gradient(90deg, #EEF0F3 25%, #F6F7F9 50%, #EEF0F3 75%); background-size: 200% 100%; animation: shimmer 1.2s infinite; border-radius: 6px; }
@keyframes shimmer { to { background-position: -200% 0; } }
.loading-block { padding: 36px; text-align: center; color: var(--muted); }
.loading-block .spin { width: 22px; height: 22px; border: 2.5px solid var(--border-strong); border-right-color: var(--accent); border-radius: 50%; animation: spin .7s linear infinite; margin: 0 auto 12px; }

/* ---------- callouts ---------- */
.callout { display: flex; gap: 12px; padding: 12px 14px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface-2); font-size: 13px; color: var(--text-2); }
.callout.warn { background: var(--warn-bg); border-color: #F6DDB4; color: #6B4300; }
.callout.info { background: var(--accent-weak); border-color: #D5E0FB; color: #1E3A8A; }
.callout.good { background: var(--good-bg); border-color: #C8E9DA; color: #0B5A3F; }
.callout svg { margin-top: 1px; }

/* ---------- modal ---------- */
.overlay { position: fixed; inset: 0; background: rgba(16, 24, 40, .42); z-index: 200; display: grid; place-items: center; padding: 24px; animation: fade .15s ease-out; }
@keyframes fade { from { opacity: 0; } }
.modal { background: var(--surface); border-radius: 14px; box-shadow: var(--shadow-lg); width: 100%; max-width: 480px; max-height: calc(100vh - 48px); display: flex; flex-direction: column; animation: rise .16s ease-out; }
.modal.wide { max-width: 760px; }
@keyframes rise { from { opacity: 0; transform: translateY(8px) scale(.98); } }
.modal-h { padding: 20px 22px 0; display: flex; gap: 14px; align-items: flex-start; }
.modal-h .ic { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; flex: none; background: var(--accent-weak); color: var(--accent); }
.modal-h .ic.danger { background: var(--bad-bg); color: var(--bad); }
.modal-h h3 { font-size: 16px; }
.modal-h p { margin: 4px 0 0; color: var(--text-2); }
.modal-h .x { margin-left: auto; }
.modal-b { padding: 18px 22px; overflow-y: auto; }
.modal-f { padding: 14px 22px; display: flex; justify-content: flex-end; gap: 10px; border-top: 1px solid var(--border); background: var(--surface-2); border-radius: 0 0 14px 14px; }

/* ---------- toast ---------- */
.toasts { position: fixed; bottom: 20px; right: 20px; z-index: 300; display: flex; flex-direction: column; gap: 10px; }
.toast { display: flex; gap: 10px; align-items: flex-start; min-width: 300px; max-width: 420px; background: var(--text); color: #fff; padding: 12px 14px; border-radius: 10px; box-shadow: var(--shadow-lg); font-size: 13.5px; animation: rise .18s ease-out; }
.toast .ic { margin-top: 1px; }
.toast.good .ic { color: #6EE7B7; } .toast.bad .ic { color: #FCA5A5; } .toast.info .ic { color: #93C5FD; }
.toast .close { margin-left: auto; background: none; border: 0; color: #9AA4B2; cursor: pointer; padding: 0; display: inline-flex; }

/* ---------- copilot ---------- */
.chat-wrap { display: grid; grid-template-columns: 260px minmax(0, 1fr); height: calc(100vh - 96px); gap: 16px; }
.chat-list { overflow-y: auto; }
.chat-list .item { display: flex; align-items: center; gap: 8px; padding: 9px 12px; border-radius: 8px; cursor: pointer; color: var(--text-2); }
.chat-list .item:hover { background: var(--neutral-bg); }
.chat-list .item.on { background: var(--accent-weak); color: var(--accent); }
.chat-list .item .t { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.chat-list .item .del { opacity: 0; }
.chat-list .item:hover .del { opacity: 1; }
.chat-main { display: flex; flex-direction: column; min-height: 0; }
.messages { flex: 1; overflow-y: auto; padding: 24px 28px; }
.msg { max-width: 860px; margin: 0 auto 22px; }
.msg.user .bubble { margin-left: auto; width: fit-content; max-width: 80%; background: var(--neutral-bg); padding: 10px 14px; border-radius: 12px; white-space: pre-wrap; }
.msg.assistant .who { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 13px; margin-bottom: 8px; }
.msg.assistant .who .av { width: 24px; height: 24px; border-radius: 7px; background: var(--text); color: #fff; display: grid; place-items: center; }
.msg.assistant .who .av svg { width: 14px; height: 14px; stroke-width: 2.2; }
.steps { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.step { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; padding: 3px 9px; border-radius: 6px; background: var(--surface-2); border: 1px solid var(--border); color: var(--text-2); }
.step .spin { width: 10px; height: 10px; border-width: 1.5px; }
.step.ok svg { color: var(--good); } .step.fail svg { color: var(--bad); }
.md { line-height: 1.62; }
.md p { margin: 0 0 10px; }
.md h1, .md h2, .md h3, .md h4 { font-size: 15px; margin: 16px 0 8px; }
.md ul, .md ol { margin: 0 0 10px; padding-left: 22px; }
.md li { margin: 3px 0; }
.md code { background: var(--neutral-bg); padding: 1px 5px; border-radius: 4px; font-size: 12.5px; }
.md pre { background: var(--surface-2); border: 1px solid var(--border); padding: 12px; border-radius: 8px; overflow-x: auto; }
.md table { border-collapse: collapse; margin: 8px 0 12px; font-size: 13px; }
.md th, .md td { border: 1px solid var(--border); padding: 6px 10px; text-align: left; }
.md th { background: var(--surface-2); }
.md blockquote { margin: 0 0 10px; padding: 4px 12px; border-left: 3px solid var(--border-strong); color: var(--text-2); }
.action-card { border: 1px solid var(--border-strong); border-radius: 10px; padding: 14px 16px; margin-top: 12px; display: flex; gap: 12px; align-items: center; background: var(--surface); }
.action-card .ic { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; background: var(--warn-bg); color: var(--warn); flex: none; }
.action-card .t { flex: 1; font-size: 13.5px; }
.composer { border-top: 1px solid var(--border); padding: 14px 28px 18px; background: var(--surface); border-radius: 0 0 var(--radius) var(--radius); }
.composer-in { max-width: 860px; margin: 0 auto; display: flex; gap: 10px; align-items: flex-end; border: 1px solid var(--border-strong); border-radius: 12px; padding: 8px 8px 8px 14px; background: var(--surface); }
.composer-in:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring); }
.composer textarea { flex: 1; border: 0; resize: none; font: inherit; max-height: 180px; min-height: 22px; padding: 6px 0; outline: none; background: transparent; }
.suggest { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; max-width: 720px; margin: 18px auto 0; }
.suggest button { text-align: left; border: 1px solid var(--border); background: var(--surface); border-radius: 10px; padding: 12px 14px; font: inherit; color: var(--text-2); cursor: pointer; }
.suggest button:hover { border-color: var(--border-strong); background: var(--surface-2); color: var(--text); }

/* ---------- login ---------- */
.login { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login .card { width: 100%; max-width: 380px; padding: 28px; }

/* idea cards */
.idea { padding: 18px 20px; display: flex; flex-direction: column; gap: 8px; }
.idea h4 { font-size: 15px; line-height: 1.4; }
.idea .kv { font-size: 13px; color: var(--text-2); }
.idea .kv b { color: var(--text); font-weight: 600; }
.idea .foot { margin-top: auto; padding-top: 8px; display: flex; gap: 8px; }

.copy-box { position: relative; }
.copy-box .btn { position: absolute; top: 8px; right: 8px; }
.pre { white-space: pre-wrap; background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; padding: 12px 14px; padding-right: 48px; font-size: 13.5px; }

.list-plain { list-style: none; margin: 0; padding: 0; }
.list-plain li { padding: 10px 0; border-bottom: 1px solid var(--border); }
.list-plain li:last-child { border-bottom: 0; }

.conn { display: flex; align-items: center; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--border); }
.conn:last-child { border-bottom: 0; }
.conn .ic { width: 36px; height: 36px; border-radius: 9px; background: var(--neutral-bg); display: grid; place-items: center; color: var(--text-2); }

.provider-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.provider { border: 1px solid var(--border-strong); border-radius: 10px; padding: 12px 14px; cursor: pointer; background: var(--surface); text-align: left; font: inherit; }
.provider:hover { background: var(--surface-2); }
.provider.on { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring); }
.provider b { display: block; font-weight: 600; }
.provider span { font-size: 12px; color: var(--muted); }

@media (max-width: 1100px) {
  .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g-side, .g-form { grid-template-columns: 1fr; }
  .g3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .sidebar { transform: translateX(-100%); }
  .main { margin-left: 0; }
  .content, .topbar { padding-left: 16px; padding-right: 16px; }
  .g2, .g3, .g4 { grid-template-columns: 1fr; }
  .chat-wrap { grid-template-columns: 1fr; }
  .chat-list { display: none; }
}

/* ---------- copilot composer (Claude-style) ---------- */
.composer { border-top: 0; padding: 8px 28px 14px; background: transparent; }
.cbox { max-width: 860px; margin: 0 auto; background: var(--surface); border: 1px solid var(--border-strong); border-radius: 18px;
  box-shadow: 0 2px 10px rgba(16, 24, 40, .06); padding: 12px 12px 10px 16px; cursor: text; transition: border-color .12s, box-shadow .12s; }
.cbox:focus-within { border-color: #B9C2CE; box-shadow: 0 4px 16px rgba(16, 24, 40, .08); }
.cbox textarea { width: 100%; border: 0; outline: none; resize: none; font: inherit; font-size: 15px; line-height: 1.5; min-height: 26px;
  max-height: 220px; background: transparent; color: var(--text); padding: 2px 0 6px; }
.cbox textarea::placeholder { color: #9AA3B0; }
.cbar { display: flex; align-items: center; gap: 6px; }
.cbtn { width: 34px; height: 34px; border-radius: 10px; border: 1px solid transparent; background: transparent; color: var(--text-2);
  display: grid; place-items: center; cursor: pointer; }
.cbtn:hover { background: var(--neutral-bg); color: var(--text); }
.cmodel { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 10px; border-radius: 10px; border: 0; background: transparent;
  font: inherit; font-size: 13.5px; font-weight: 600; color: var(--text); cursor: pointer; }
.cmodel:hover { background: var(--neutral-bg); }
.cmodel .cdepth { font-weight: 500; color: var(--muted); }
.cmodel svg { color: var(--muted); }
.csend { width: 46px; height: 34px; border-radius: 11px; border: 0; background: #1F2328; color: #fff; display: grid; place-items: center; cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.08); transition: background .12s, transform .06s; }
.csend:hover:not(:disabled) { background: #000; }
.csend:active:not(:disabled) { transform: scale(.96); }
.csend:disabled { background: #E4E7EB; color: #9AA3B0; cursor: default; box-shadow: none; }
.csend.stop { background: var(--text); }
.csend svg { width: 17px; height: 17px; stroke-width: 2.2; }
.cnote { text-align: center; font-size: 12px; color: var(--muted); margin-top: 8px; }
.cpop { min-width: 260px; max-width: 320px; padding: 6px; position: fixed; overflow-y: auto; }
.cpop-h { font-size: 11.5px; font-weight: 600; color: var(--muted); padding: 8px 10px 4px; text-transform: uppercase; letter-spacing: .05em; }
.cpop-sep { height: 1px; background: var(--border); margin: 6px 4px; }
.chat-main { background: var(--surface); }
