/* ReCorp Ops dashboard. One accent, neutral greys, 4/8 px spacing grid, soft depth. */
:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --surface-2: #fafbfc;
  --line: #e9ebef;
  --line-2: #f1f2f5;
  --text: #0e1116;
  --text-2: #4a5160;
  --muted: #6b7280;
  --accent: #4f46e5;
  --accent-2: #6366f1;
  --accent-soft: #eef0ff;
  --accent-ring: rgba(79, 70, 229, .18);
  --ok: #047857;   --ok-soft: #e7f7f0;
  --warn: #b45309; --warn-soft: #fdf3e2;
  --bad: #e11d48;  --bad-soft: #fdecf0;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow-1: 0 1px 2px rgba(16, 24, 40, .04), 0 1px 1px rgba(16, 24, 40, .03);
  --shadow-2: 0 1px 2px rgba(16, 24, 40, .05), 0 10px 30px -12px rgba(16, 24, 40, .14);
  --shadow-3: 0 24px 60px -20px rgba(16, 24, 40, .35), 0 2px 6px rgba(16, 24, 40, .06);
  --ease: cubic-bezier(.2, .8, .2, 1);
  --sidebar: 248px;
  font-family: Inter, "Noto Sans Bengali", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-feature-settings: "cv11", "ss01", "tnum";
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); }
body { font-size: 14px; line-height: 1.5; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
::selection { background: var(--accent-soft); }
.num { font-variant-numeric: tabular-nums; }

/* ---------- shell ---------- */
.shell { display: grid; grid-template-columns: var(--sidebar) 1fr; min-height: 100vh; }
.side {
  position: sticky; top: 0; height: 100vh; overflow-y: auto; padding: 18px 14px 14px;
  background: var(--surface); border-right: 1px solid var(--line); display: flex; flex-direction: column; gap: 4px;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 18px; font-weight: 700; letter-spacing: -.01em; }
.brand .logo { width: 30px; height: 30px; border-radius: 9px; background: linear-gradient(135deg, var(--accent), #7c3aed); display: grid; place-items: center; box-shadow: 0 6px 16px -6px var(--accent); }
.brand .logo svg { width: 17px; height: 17px; stroke: #fff; }
.brand small { display: block; font-weight: 500; color: var(--muted); font-size: 11.5px; margin-top: -2px; }
.nav-label { font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); padding: 14px 10px 6px; }
.nav a {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 9px; color: var(--text-2); font-weight: 500;
  transition: background .18s var(--ease), color .18s var(--ease);
}
.nav a svg { width: 18px; height: 18px; flex: none; stroke: currentColor; opacity: .85; }
.nav a:hover { background: var(--line-2); color: var(--text); }
.nav a.on { background: var(--accent-soft); color: var(--accent); }
.nav a .badge { margin-left: auto; }
.nav .ws-link { padding-left: 12px; font-size: 13.5px; }
.nav .ws-link .dot { margin-left: auto; }
.side-foot { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--line-2); display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; }

.main { min-width: 0; display: flex; flex-direction: column; }
.top {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px; padding: 14px 28px;
  background: rgba(246, 247, 249, .82); backdrop-filter: saturate(180%) blur(14px); border-bottom: 1px solid transparent;
  transition: border-color .2s;
}
.top.scrolled { border-bottom-color: var(--line); }
.crumbs { display: flex; align-items: center; gap: 8px; color: var(--muted); font-weight: 500; min-width: 0; }
.crumbs b { color: var(--text); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.crumbs svg { width: 14px; height: 14px; stroke: currentColor; }
.top .grow { flex: 1; }
.search-btn {
  display: flex; align-items: center; gap: 10px; min-width: 260px; padding: 8px 10px 8px 12px; border-radius: 10px;
  background: var(--surface); border: 1px solid var(--line); color: var(--muted); cursor: pointer; box-shadow: var(--shadow-1);
  transition: border-color .2s, box-shadow .2s;
}
.search-btn:hover { border-color: #d9dce3; box-shadow: var(--shadow-2); }
.search-btn svg { width: 16px; height: 16px; stroke: currentColor; }
.search-btn kbd { margin-left: auto; }
kbd { font: 500 11px/1 Inter, sans-serif; padding: 4px 6px; border-radius: 6px; background: var(--line-2); color: var(--text-2); border: 1px solid var(--line); }
.live { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--text-2); font-weight: 500; }
.btn.menu-btn { display: none; }

.page { padding: 8px 28px 48px; max-width: 1360px; width: 100%; animation: rise .45s var(--ease) both; }
.page-head { display: flex; align-items: flex-end; gap: 16px; margin: 10px 0 22px; flex-wrap: wrap; }
.page-head h1 { font-size: 26px; line-height: 1.2; letter-spacing: -.025em; margin: 0; font-weight: 700; }
.page-head p { margin: 4px 0 0; color: var(--muted); }
.page-head .actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- building blocks ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-1); }
.card.pad { padding: 18px 20px; }
.card-h { display: flex; align-items: center; gap: 10px; padding: 16px 20px 12px; }
.card-h h3 { margin: 0; font-size: 14.5px; font-weight: 600; letter-spacing: -.01em; }
.card-h .sub { color: var(--muted); font-size: 12.5px; }
.card-h .tools { margin-left: auto; display: flex; gap: 6px; }
.card-b { padding: 0 20px 18px; }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g-cards { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
.stack { display: flex; flex-direction: column; gap: 16px; }
.row { display: flex; align-items: center; gap: 10px; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.ell { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.mono { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 12.5px; }
hr.sep { border: 0; border-top: 1px solid var(--line-2); margin: 14px 0; }

.btn {
  display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--surface); color: var(--text); font-weight: 500; cursor: pointer; white-space: nowrap; box-shadow: var(--shadow-1);
  transition: transform .12s var(--ease), box-shadow .2s, background .2s, border-color .2s;
}
.btn:hover { border-color: #d9dce3; box-shadow: var(--shadow-2); }
.btn:active { transform: translateY(1px) scale(.99); }
.btn svg { width: 16px; height: 16px; stroke: currentColor; }
.btn.primary { background: var(--accent); color: #fff; border-color: transparent; box-shadow: 0 1px 2px rgba(79, 70, 229, .3), 0 8px 18px -10px var(--accent); }
.btn.primary:hover { background: #4338ca; }
.btn.ghost { background: transparent; border-color: transparent; box-shadow: none; color: var(--text-2); }
.btn.ghost:hover { background: var(--line-2); color: var(--text); }
.btn.danger { color: var(--bad); }
.btn.sm { height: 30px; padding: 0 10px; font-size: 13px; border-radius: 8px; }
.btn.icon { width: 34px; padding: 0; justify-content: center; }
.btn[disabled] { opacity: .55; pointer-events: none; }
.btn .spin { width: 15px; height: 15px; }

.badge { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px; border-radius: 999px; font-size: 11.5px; font-weight: 600; background: var(--line-2); color: var(--text-2); }
.badge.accent { background: var(--accent); color: #fff; }
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.bad { background: var(--bad-soft); color: var(--bad); }
.badge.soft { background: var(--accent-soft); color: var(--accent); }

.dot { width: 8px; height: 8px; border-radius: 50%; background: #c7cbd3; flex: none; }
.dot.ok { background: var(--ok); }
.dot.bad { background: var(--bad); }
.dot.warn { background: #f59e0b; }
.dot.live { background: var(--ok); box-shadow: 0 0 0 0 rgba(5, 150, 105, .5); animation: pulse 2s infinite; }

/* KPIs */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 16px; }
.kpi { padding: 16px 18px; }
.kpi .label { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 12.5px; font-weight: 500; }
.kpi .label svg { width: 15px; height: 15px; stroke: currentColor; }
.kpi .value { font-size: 28px; font-weight: 700; letter-spacing: -.03em; margin-top: 6px; line-height: 1.1; }
.kpi .hint { font-size: 12px; color: var(--muted); margin-top: 4px; }
.delta { font-size: 12px; font-weight: 600; }
.delta.up { color: var(--ok); } .delta.down { color: var(--bad); }

/* business cards */
.biz { padding: 18px 20px 14px; cursor: pointer; transition: transform .25s var(--ease), box-shadow .25s var(--ease), border-color .25s; position: relative; overflow: hidden; }
.biz:hover { transform: translateY(-2px); box-shadow: var(--shadow-2); border-color: #dfe2e8; }
.biz .head { display: flex; align-items: center; gap: 10px; }
.biz .avatar { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; font-weight: 700; font-size: 14px; color: #fff; flex: none; }
.biz h3 { margin: 0; font-size: 15.5px; letter-spacing: -.01em; }
.biz .site { color: var(--muted); font-size: 12.5px; }
.biz .metrics { display: flex; gap: 22px; margin: 16px 0 6px; }
.biz .metrics .v { font-size: 22px; font-weight: 700; letter-spacing: -.02em; }
.biz .metrics .k { font-size: 12px; color: var(--muted); }
.biz .spark { height: 54px; margin: 0 -4px; }
.biz .chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 9px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); font-size: 12px; color: var(--text-2); transition: border-color .2s, color .2s; }
.chip:hover { border-color: var(--accent); color: var(--accent); }
.biz .warnline { display: flex; align-items: center; gap: 8px; margin-top: 12px; padding: 9px 11px; border-radius: 10px; background: var(--warn-soft); color: var(--warn); font-size: 12.5px; font-weight: 500; }
.biz .warnline svg, .note svg { width: 15px; height: 15px; stroke: currentColor; flex: none; }

/* charts */
.chart { position: relative; height: 220px; }
.chart svg { width: 100%; height: 100%; overflow: visible; }
.chart .grid-line { stroke: var(--line-2); }
.chart .axis { fill: var(--muted); font-size: 11px; }
.chart .area-line { fill: none; stroke: var(--accent); stroke-width: 2.2; stroke-linejoin: round; stroke-linecap: round; }
.draw { stroke-dasharray: var(--len); stroke-dashoffset: var(--len); animation: draw 1.1s var(--ease) forwards; }
.fade-area { opacity: 0; animation: fadein .9s .25s var(--ease) forwards; }
.tip { position: absolute; pointer-events: none; transform: translate(-50%, -100%); padding: 7px 10px; border-radius: 9px; background: var(--text); color: #fff; font-size: 12px; white-space: nowrap; box-shadow: var(--shadow-3); opacity: 0; transition: opacity .12s; margin-top: -10px; }
.tip.on { opacity: 1; }
.cross { stroke: #d4d7de; stroke-dasharray: 3 3; }

/* lists + tables */
.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; align-items: center; gap: 12px; padding: 10px 20px; border-top: 1px solid var(--line-2); min-width: 0; }
.list li:first-child { border-top: 0; }
.list li.click { cursor: pointer; transition: background .15s; }
.list li.click:hover { background: var(--surface-2); }
.bar { position: relative; height: 6px; border-radius: 99px; background: var(--line-2); overflow: hidden; flex: none; width: 90px; }
.bar i { position: absolute; inset: 0 auto 0 0; border-radius: 99px; background: linear-gradient(90deg, var(--accent-2), var(--accent)); transform-origin: left; animation: grow .9s var(--ease) both; }
table.t { width: 100%; border-collapse: collapse; }
table.t th { text-align: left; font-size: 11.5px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); padding: 10px 20px; border-bottom: 1px solid var(--line); background: var(--surface-2); }
table.t td { padding: 11px 20px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
table.t tr:last-child td { border-bottom: 0; }
table.t tr.click { cursor: pointer; transition: background .15s; }
table.t tr.click:hover td { background: var(--surface-2); }
.scroll-x { overflow-x: auto; }

/* empty + skeleton + notes */
.empty { text-align: center; padding: 36px 20px; color: var(--muted); }
.empty .ico { width: 44px; height: 44px; margin: 0 auto 10px; border-radius: 12px; display: grid; place-items: center; background: var(--line-2); }
.empty .ico svg { width: 20px; height: 20px; stroke: var(--muted); }
.empty b { display: block; color: var(--text); font-weight: 600; margin-bottom: 4px; }
.sk { border-radius: 8px; background: linear-gradient(90deg, #eef0f3 0%, #f6f7f9 50%, #eef0f3 100%); background-size: 200% 100%; animation: shimmer 1.3s infinite linear; }
.note { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; background: var(--accent-soft); color: #3730a3; font-size: 13px; }
.note.warn { background: var(--warn-soft); color: var(--warn); }
.note code, .md code { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12px; background: rgba(255,255,255,.7); padding: 1px 5px; border-radius: 5px; }

/* approvals */
.approval { padding: 18px 20px; animation: rise .35s var(--ease) both; }
.approval h4 { margin: 0 0 4px; font-size: 15px; }
.approval .body { white-space: pre-wrap; background: var(--surface-2); border: 1px solid var(--line-2); border-radius: 10px; padding: 12px 14px; margin: 12px 0; font-size: 13.5px; color: var(--text-2); max-height: 260px; overflow: auto; }
.approval textarea { width: 100%; min-height: 120px; }
.approval.leave { animation: leave .35s var(--ease) forwards; }

/* events feed */
.feed li { align-items: flex-start; }
.feed .icon { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; flex: none; background: var(--line-2); }
.feed .icon svg { width: 15px; height: 15px; stroke: var(--text-2); }
.feed .icon.bad { background: var(--bad-soft); } .feed .icon.bad svg { stroke: var(--bad); }
.feed .icon.ok { background: var(--ok-soft); } .feed .icon.ok svg { stroke: var(--ok); }
.feed .icon.warn { background: var(--warn-soft); } .feed .icon.warn svg { stroke: var(--warn); }
.feed li.new { animation: slidein .5s var(--ease) both; background: linear-gradient(90deg, var(--accent-soft), transparent 60%); }

/* workflow pipeline */
.pipe { list-style: none; margin: 0; padding: 4px 20px 18px; position: relative; }
.pipe li { position: relative; display: flex; gap: 12px; padding: 8px 0; animation: rise .4s var(--ease) both; }
.pipe li::before { content: ""; position: absolute; left: 15px; top: 38px; bottom: -8px; width: 2px; background: var(--line); }
.pipe li:last-child::before { display: none; }
.pipe .node { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; flex: none; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-1); z-index: 1; }
.pipe .node svg { width: 15px; height: 15px; stroke: var(--text-2); }
.pipe .node.ai { background: linear-gradient(135deg, #eef0ff, #f5edff); border-color: #dcd9fb; } .pipe .node.ai svg { stroke: var(--accent); }
.pipe .node.approve { background: var(--warn-soft); border-color: #f6dfb4; } .pipe .node.approve svg { stroke: var(--warn); }
.pipe .node.send { background: var(--ok-soft); border-color: #c9ecdc; } .pipe .node.send svg { stroke: var(--ok); }
.pipe .what { min-width: 0; padding-top: 5px; }
.pipe .what b { font-weight: 600; font-size: 13.5px; }
.pipe .what div { color: var(--muted); font-size: 12.5px; }
.pipe .nest { margin: 6px 0 0 6px; padding-left: 14px; border-left: 2px dashed var(--line); }
.pipe .nest .pipe { padding: 0; }

/* forms */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field label { font-size: 12.5px; font-weight: 600; color: var(--text-2); }
.field .hint { font-size: 12px; color: var(--muted); }
.input, select.input, textarea.input {
  width: 100%; height: 38px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); outline: none;
  transition: border-color .2s, box-shadow .2s;
}
textarea.input { height: auto; padding: 10px 12px; resize: vertical; line-height: 1.5; }
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-ring); }
.switch { position: relative; width: 38px; height: 22px; border-radius: 99px; background: #d7dae1; cursor: pointer; transition: background .2s var(--ease); flex: none; border: 0; padding: 0; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.2); transition: transform .25s var(--ease); }
.switch.on { background: var(--accent); }
.switch.on::after { transform: translateX(16px); }
.seg { display: inline-flex; padding: 3px; background: var(--line-2); border-radius: 10px; gap: 2px; }
.seg button { border: 0; background: transparent; padding: 6px 12px; border-radius: 8px; font-weight: 500; color: var(--text-2); cursor: pointer; transition: background .2s, color .2s, box-shadow .2s; }
.seg button.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow-1); }

/* memory */
.mem { display: grid; grid-template-columns: 280px 1fr; gap: 16px; }
.tree a { display: flex; align-items: center; gap: 8px; padding: 7px 12px; border-radius: 8px; color: var(--text-2); font-size: 13px; }
.tree a svg { width: 15px; height: 15px; stroke: currentColor; flex: none; }
.tree a:hover { background: var(--line-2); }
.tree a.on { background: var(--accent-soft); color: var(--accent); }
.md { line-height: 1.7; color: var(--text-2); }
.md h1, .md h2, .md h3 { color: var(--text); letter-spacing: -.015em; margin: 1.1em 0 .4em; line-height: 1.3; }
.md h1 { font-size: 21px; margin-top: 0; } .md h2 { font-size: 17px; } .md h3 { font-size: 15px; }
.md ul { padding-left: 20px; } .md li { margin: 3px 0; }
.md pre { background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 12px; overflow: auto; }

/* overlays: palette, modal, toasts */
.overlay { position: fixed; inset: 0; z-index: 60; background: rgba(15, 18, 25, .28); backdrop-filter: blur(3px); display: grid; place-items: start center; padding-top: 12vh; animation: fadein .18s ease both; }
.palette, .modal { width: min(640px, calc(100vw - 32px)); background: var(--surface); border-radius: 16px; box-shadow: var(--shadow-3); border: 1px solid var(--line); overflow: hidden; animation: pop .22s var(--ease) both; }
.palette .q { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.palette .q svg { width: 18px; height: 18px; stroke: var(--muted); }
.palette .q input { flex: 1; border: 0; outline: 0; font-size: 15px; background: transparent; }
.palette ul { list-style: none; margin: 0; padding: 6px; max-height: 50vh; overflow: auto; }
.palette li { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 9px; cursor: pointer; }
.palette li .k { font-size: 11.5px; color: var(--muted); margin-left: auto; }
.palette li.sel { background: var(--accent-soft); }
.palette li svg { width: 16px; height: 16px; stroke: var(--text-2); }
.palette .out { border-top: 1px solid var(--line); max-height: 40vh; overflow: auto; padding: 12px 16px; background: var(--surface-2); }
.palette .group { padding: 8px 10px 4px; font-size: 11px; font-weight: 600; color: var(--muted); letter-spacing: .05em; text-transform: uppercase; }
.modal .mh { padding: 18px 20px 6px; } .modal .mh h3 { margin: 0; font-size: 17px; letter-spacing: -.015em; }
.modal .mb { padding: 10px 20px; max-height: 62vh; overflow: auto; }
.modal .mf { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--line-2); background: var(--surface-2); }
.toasts { position: fixed; right: 20px; bottom: 20px; z-index: 80; display: flex; flex-direction: column; gap: 8px; }
.toast { display: flex; align-items: center; gap: 10px; min-width: 260px; max-width: 420px; padding: 12px 14px; border-radius: 12px; background: var(--text); color: #fff; box-shadow: var(--shadow-3); animation: toastin .35s var(--ease) both; font-size: 13.5px; }
.toast svg { width: 16px; height: 16px; stroke: #a5f3c9; flex: none; }
.toast.bad svg { stroke: #fda4af; }
.toast.out { animation: toastout .3s var(--ease) forwards; }

/* login */
.login { min-height: 100vh; display: grid; place-items: center; padding: 24px; background:
  radial-gradient(900px 500px at 20% -10%, #e8e9ff 0%, transparent 60%), radial-gradient(800px 500px at 110% 110%, #f1e9ff 0%, transparent 55%), var(--bg); }
.login .card { width: min(420px, 100%); padding: 30px; box-shadow: var(--shadow-2); animation: pop .4s var(--ease) both; }
.login h1 { font-size: 22px; letter-spacing: -.02em; margin: 18px 0 6px; }

.spin { animation: spin 1s linear infinite; }

/* motion */
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes pop { from { opacity: 0; transform: scale(.97) translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes fadein { from { opacity: 0; } to { opacity: 1; } }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes grow { from { transform: scaleX(0); } }
@keyframes shimmer { to { background-position: -200% 0; } }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(5,150,105,.45); } 70% { box-shadow: 0 0 0 7px rgba(5,150,105,0); } 100% { box-shadow: 0 0 0 0 rgba(5,150,105,0); } }
@keyframes slidein { from { opacity: 0; transform: translateX(-10px); } }
@keyframes leave { to { opacity: 0; transform: translateX(24px); height: 0; padding: 0; margin: 0; } }
@keyframes toastin { from { opacity: 0; transform: translateY(12px) scale(.98); } }
@keyframes toastout { to { opacity: 0; transform: translateY(8px); } }
@keyframes spin { to { transform: rotate(360deg); } }
.stagger > * { animation: rise .45s var(--ease) both; }
.stagger > *:nth-child(2) { animation-delay: .04s; } .stagger > *:nth-child(3) { animation-delay: .08s; }
.stagger > *:nth-child(4) { animation-delay: .12s; } .stagger > *:nth-child(5) { animation-delay: .16s; }
.stagger > *:nth-child(n+6) { animation-delay: .2s; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } .draw { stroke-dashoffset: 0; } .fade-area { opacity: 1; } }

/* responsive */
@media (max-width: 1100px) { .g3 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; z-index: 70; left: 0; top: 0; width: 280px; transform: translateX(-100%); transition: transform .3s var(--ease); box-shadow: var(--shadow-3); }
  .shell.menu .side { transform: none; }
  .shell.menu::after { content: ""; position: fixed; inset: 0; z-index: 65; background: rgba(15,18,25,.3); }
  .btn.menu-btn { display: inline-flex; }
  .top { padding: 12px 16px; }
  .page { padding: 4px 16px 40px; }
  .search-btn { min-width: 0; } .search-btn span, .search-btn kbd { display: none; }
  .g2, .g3, .mem { grid-template-columns: 1fr; }
  .live .txt { display: none; }
}

/* ---------- assistant (chat) ---------- */
.page.chatpage { max-width: none; padding: 0; height: calc(100dvh - 67px); display: flex; flex-direction: column; }
.page.chatpage > .page-head { padding: 8px 28px 0; }
.page.chatpage > .card { margin: 0 28px; }
.chat-wrap { flex: 1; min-height: 0; display: grid; grid-template-rows: minmax(0, 1fr); grid-template-columns: 260px minmax(0, 1fr); border-top: 1px solid var(--line); }
.chat-wrap.with-right { grid-template-columns: 260px minmax(0, 1fr) 300px; }
.chat-side { border-right: 1px solid var(--line); background: var(--surface); padding: 14px 12px; display: flex; flex-direction: column; gap: 10px; min-height: 0; }
.chat-side .seg button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.chat-side .seg svg { width: 14px; height: 14px; stroke: currentColor; }
.chat-list { overflow-y: auto; display: flex; flex-direction: column; gap: 2px; margin: 0 -4px; padding: 0 4px; }
.chat-item { display: flex; align-items: center; gap: 8px; padding: 9px 10px; border-radius: 9px; color: var(--text-2); font-size: 13.5px; transition: background .15s; }
.chat-item:hover { background: var(--line-2); }
.chat-item.on { background: var(--accent-soft); color: var(--accent); font-weight: 500; }
.chat-main { display: flex; flex-direction: column; min-width: 0; min-height: 0; background: var(--bg); }
.chat-head { display: flex; align-items: center; gap: 10px; padding: 12px 20px; border-bottom: 1px solid var(--line); background: rgba(255, 255, 255, .7); backdrop-filter: blur(8px); }
.chat-head h3 { margin: 0; font-size: 15px; cursor: text; min-width: 0; }
.chat-head .badge svg { width: 12px; height: 12px; stroke: currentColor; }
.chat-head .grow, .row .grow { flex: 1; }
.chat-scroll { flex: 1; overflow-y: auto; padding: 24px 20px 12px; }
.thread { max-width: 820px; margin: 0 auto; display: flex; flex-direction: column; gap: 18px; }
.msg { display: flex; gap: 12px; animation: rise .35s var(--ease) both; }
.msg.user { justify-content: flex-end; }
.msg.user .bubble { max-width: 78%; background: var(--accent); color: #fff; padding: 11px 15px; border-radius: 16px 16px 4px 16px; white-space: pre-wrap; box-shadow: 0 6px 18px -10px var(--accent); line-height: 1.55; }
.msg.ai .abody { flex: 1; min-width: 0; }
.orb-sm, .orb-lg { flex: none; display: grid; place-items: center; background: linear-gradient(135deg, var(--accent), #7c3aed); box-shadow: 0 6px 16px -8px var(--accent); }
.orb-sm { width: 30px; height: 30px; border-radius: 10px; }
.orb-sm svg { width: 16px; height: 16px; stroke: #fff; }
.orb-lg { width: 56px; height: 56px; border-radius: 18px; margin: 0 auto 16px; animation: pop .5s var(--ease) both; }
.orb-lg svg { width: 26px; height: 26px; stroke: #fff; }
.chat-md { color: var(--text); line-height: 1.65; }
.chat-md > :first-child { margin-top: 0; }
.chat-md p { margin: .5em 0; }
.chat-md h2, .chat-md h3, .chat-md h4 { font-size: 15px; margin: 1em 0 .3em; }
.chat-md pre { background: #0f1220; color: #e7e9f3; border: 0; border-radius: 12px; padding: 14px 16px; font-size: 12.5px; }
.chat-md table.t { font-size: 13px; margin: 8px 0; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.chat-md table.t th, .chat-md table.t td { padding: 7px 12px; }
.chat-md blockquote { margin: .6em 0; padding: 6px 12px; border-left: 3px solid var(--accent-2); color: var(--text-2); background: var(--surface); border-radius: 0 8px 8px 0; }
.chat-md a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
.md ol { padding-left: 22px; }
.typing { display: inline-flex; gap: 5px; padding: 10px 2px; }
.typing i { width: 7px; height: 7px; border-radius: 50%; background: #b9bcc7; animation: blink 1.2s infinite ease-in-out; }
.typing i:nth-child(2) { animation-delay: .15s; }
.typing i:nth-child(3) { animation-delay: .3s; }
@keyframes blink { 0%, 80%, 100% { opacity: .3; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }
.steps { margin: 0 0 10px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); overflow: hidden; }
.steps summary { display: flex; align-items: center; gap: 8px; padding: 8px 12px; cursor: pointer; font-size: 12.5px; font-weight: 600; color: var(--text-2); list-style: none; }
.steps summary::-webkit-details-marker { display: none; }
.steps summary svg { width: 14px; height: 14px; stroke: var(--ok); }
.steps ul { list-style: none; margin: 0; padding: 4px 12px 10px; border-top: 1px solid var(--line-2); }
.steps li { display: flex; align-items: center; gap: 8px; padding: 4px 0; font-size: 12.5px; min-width: 0; flex-wrap: wrap; }
.steps li .st svg { width: 13px; height: 13px; stroke: var(--ok); }
.steps li.err .st svg { stroke: var(--bad); }
.steps li.run .st svg { stroke: var(--accent); }
.steps li .ell { flex: 1; min-width: 0; }
.err { color: var(--bad); width: 100%; }
.meta { margin-top: 8px; font-size: 11.5px; color: var(--muted); }
.chat-note { display: flex; align-items: center; justify-content: center; gap: 6px; font-size: 12.5px; color: var(--muted); text-align: center; animation: rise .35s var(--ease) both; }
.chat-note svg { width: 13px; height: 13px; stroke: currentColor; }
.action-card { padding: 14px 16px; border-left: 3px solid #f59e0b; animation: pop .3s var(--ease) both; }
.action-card.done { border-left-color: var(--ok); }
.action-card.rejected, .action-card.failed { border-left-color: var(--bad); }
.action-card .row svg { width: 16px; height: 16px; stroke: currentColor; }
.action-card .asum { white-space: pre-wrap; font: 13px/1.55 Inter, sans-serif; background: var(--surface-2); border: 1px solid var(--line-2); border-radius: 10px; padding: 10px 12px; margin: 10px 0; max-height: 220px; overflow: auto; }
.changes { padding: 12px 14px; margin-top: 10px; }
.changes .row svg { width: 15px; height: 15px; stroke: currentColor; }
.changes ul { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.changes li { display: flex; align-items: center; gap: 8px; font-size: 12.5px; min-width: 0; }
.composer { padding: 10px 20px 16px; }
.composer-box { max-width: 820px; margin: 0 auto; display: flex; align-items: flex-end; gap: 8px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 8px 8px 8px 14px; box-shadow: var(--shadow-2); transition: border-color .2s, box-shadow .2s; }
.composer-box:focus-within { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-ring), var(--shadow-2); }
.composer textarea { flex: 1; border: 0; outline: 0; resize: none; background: transparent; line-height: 1.5; padding: 6px 0; max-height: 220px; }
.composer .send { width: 38px; height: 38px; border-radius: 11px; border: 0; background: var(--accent); display: grid; place-items: center; cursor: pointer; transition: transform .12s var(--ease), background .2s; flex: none; }
.composer .send:hover { background: #4338ca; }
.composer .send:active { transform: scale(.94); }
.composer .send svg { width: 17px; height: 17px; stroke: #fff; }
.composer .send.stop { background: var(--text); }
.composer .mic { position: relative; width: 38px; height: 38px; border-radius: 11px; border: 0; background: transparent; color: var(--muted); display: grid; place-items: center; cursor: pointer; flex: none; transition: background .2s, color .2s; }
.composer .mic:hover { background: var(--accent-ring); color: var(--accent); }
.composer .mic svg { width: 18px; height: 18px; stroke: currentColor; }
.composer .mic.listening { background: #dc2626; color: #fff; animation: mic-pulse 1.4s ease-out infinite; }
.composer .mic.listening svg { fill: currentColor; width: 14px; height: 14px; }
.composer .mic.busy { color: var(--accent); cursor: pointer; }
.composer .mic.busy svg { animation: spin .9s linear infinite; }
.composer .mic.speaking { background: var(--accent); color: #fff; }
.composer .mic.live-btn.on { background: var(--ok, #047857); color: #fff; animation: mic-pulse 1.4s ease-out infinite; }
.live-bar .live-line { font-size: 13.5px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.live-bar .live-line.ai { color: var(--muted); }
.live-bar .live-line:empty { display: none; }
.live-float { position: fixed; z-index: 62; right: 20px; bottom: 20px; width: min(360px, calc(100vw - 32px)); max-height: min(460px, calc(100vh - 40px)); display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow-3); overflow: hidden; animation: fadein .2s ease both; }
.live-float[hidden] { display: none; }
.live-float .lf-head { display: flex; align-items: center; gap: 8px; padding: 10px 10px 10px 12px; border-bottom: 1px solid var(--line-2); }
.live-float .lf-title { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.live-float .lf-title b { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.live-float .lf-list { flex: 1; min-height: 120px; max-height: 300px; overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.live-float .lf-line { max-width: 88%; padding: 7px 10px; border-radius: 12px; font-size: 13.5px; line-height: 1.45; background: var(--accent-soft); align-self: flex-start; }
.live-float .lf-line.you { align-self: flex-end; background: var(--accent); color: #fff; }
.live-float .lf-line.note { max-width: 100%; align-self: stretch; background: none; padding: 0 2px; color: var(--muted); font-size: 12.5px; display: flex; gap: 6px; align-items: flex-start; }
.live-float .lf-line.note svg { width: 13px; height: 13px; stroke: currentColor; flex: none; margin-top: 3px; }
.live-float .lf-empty { margin: auto; }
.live-float .lf-foot { display: flex; align-items: center; gap: 6px; padding: 8px; border-top: 1px solid var(--line-2); }
.live-float .lf-input { flex: 1; min-width: 0; height: 36px; border: 1px solid var(--line); border-radius: 10px; padding: 0 10px; font: inherit; font-size: 13.5px; background: var(--bg, #fff); color: var(--text); }
.live-float .lf-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring); }
.live-float .lf-btn { width: 34px; height: 34px; flex: none; border: 0; border-radius: 10px; background: transparent; color: var(--muted); display: grid; place-items: center; cursor: pointer; }
.live-float .lf-btn:hover { background: var(--accent-ring); color: var(--accent); }
.live-float .lf-btn.on { background: #fee2e2; color: #dc2626; }
.live-float .lf-btn.send { color: var(--accent); }
.live-float .lf-btn svg, .live-float .lf-end svg { width: 16px; height: 16px; stroke: currentColor; }
.live-float .lf-end { height: 32px; padding: 0 10px; border: 0; border-radius: 10px; background: #dc2626; color: #fff; display: inline-flex; align-items: center; gap: 6px; font: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer; flex: none; }
.live-float .lf-end:hover { background: #b91c1c; }
.live-float.min { width: auto; max-width: calc(100vw - 32px); border-radius: 999px; }
.live-float.min .lf-head { border-bottom: 0; padding: 6px 6px 6px 8px; }
.live-float.min .lf-list, .live-float.min .lf-foot, .live-float.min [title="Open the chat"] { display: none; }
.live-float .talk-orb { width: 30px; height: 30px; }
.live-float.hearing .talk-orb { background: rgba(220, 38, 38, .12); }
.live-float.hearing .talk-orb i { background: #dc2626; animation: talk-wave .9s ease-in-out infinite; }
.live-float.speaking .talk-orb i { animation: talk-wave .9s ease-in-out infinite; }
.live-float.thinking .talk-orb i { animation: talk-dot 1.2s ease-in-out infinite; height: 4px; }
body.live-float-on .toasts { bottom: calc(32px + var(--live-float-h, 0px)); }
@media (max-width: 640px) { .live-float { right: 16px; bottom: 16px; } }
.talk-bar { max-width: 820px; margin: 0 auto 8px; display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-2); cursor: default; }
.talk-bar.speaking { cursor: pointer; border-color: var(--accent); }
.talk-bar[hidden] { display: none; }
.talk-mid { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.talk-mid b { font-size: 12.5px; }
.talk-text { font-size: 14px; color: var(--text); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.talk-orb { flex: none; width: 34px; height: 34px; border-radius: 50%; display: grid; grid-auto-flow: column; place-content: center; gap: 3px; background: var(--accent-ring); }
.talk-orb i { width: 4px; height: 8px; border-radius: 2px; background: var(--accent); }
.talk-bar.listening .talk-orb, .talk-bar.hearing .talk-orb { background: rgba(220, 38, 38, .12); }
.talk-bar.listening .talk-orb i, .talk-bar.hearing .talk-orb i { background: #dc2626; }
.talk-bar.hearing .talk-orb i, .talk-bar.speaking .talk-orb i { animation: talk-wave .9s ease-in-out infinite; }
.talk-orb i:nth-child(2) { animation-delay: .15s !important; }
.talk-orb i:nth-child(3) { animation-delay: .3s !important; }
.talk-bar.thinking .talk-orb i, .talk-bar.working .talk-orb i { animation: talk-dot 1.2s ease-in-out infinite; height: 4px; }
@keyframes talk-wave { 0%, 100% { height: 6px; } 50% { height: 20px; } }
@keyframes talk-dot { 0%, 100% { opacity: .3; } 50% { opacity: 1; } }
.spoken { display: flex; gap: 8px; align-items: flex-start; padding: 8px 12px; margin-bottom: 8px; border-radius: 10px; background: var(--accent-ring); font-size: 14.5px; line-height: 1.5; }
.spoken svg { width: 15px; height: 15px; stroke: var(--accent); flex: none; margin-top: 3px; }
.msg.user .said svg { width: 12px; height: 12px; stroke: currentColor; opacity: .7; margin-right: 6px; vertical-align: -1px; }
.choices { display: flex; flex-direction: column; gap: 6px; margin-top: 12px; max-width: 560px; }
.choice { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 12px; text-align: left; font: inherit; color: var(--text); background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; cursor: pointer; transition: border-color .15s, background .15s, transform .1s; }
.choice:hover:not(:disabled) { border-color: var(--accent); background: var(--accent-soft); }
.choice:active:not(:disabled) { transform: scale(.995); }
.choice .cnum { width: 24px; height: 24px; flex: none; display: grid; place-items: center; border-radius: 7px; font-size: 12px; font-weight: 700; color: var(--accent); background: var(--accent-soft); }
.choice .ctext { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.choice > svg { width: 16px; height: 16px; flex: none; opacity: .4; }
.choice.other { background: transparent; border-style: dashed; }
.choices.locked .choice { cursor: default; opacity: .5; }
.choices.locked .choice.other { display: none; }
.choices.locked .choice.chosen { opacity: 1; border-color: var(--accent); background: var(--accent-soft); }
.choices.locked .choice.chosen .cnum { color: #fff; background: var(--accent); }
.say-btn { width: 26px; height: 26px; padding: 0; margin-right: 6px; }
.say-btn.on { color: var(--accent); background: var(--accent-ring); }
.say-btn svg { width: 14px; height: 14px; }
@keyframes mic-pulse { 0% { box-shadow: 0 0 0 0 rgba(220, 38, 38, .45); } 100% { box-shadow: 0 0 0 10px rgba(220, 38, 38, 0); } }
.composer-hint { max-width: 820px; margin: 7px auto 0; display: flex; justify-content: space-between; font-size: 11.5px; color: var(--muted); }
.composer-hint svg { width: 12px; height: 12px; stroke: currentColor; }
.ai-pick { position: relative; }
.ai-pick-btn { display: inline-flex; align-items: center; gap: 6px; max-width: 260px; height: 26px; padding: 0 9px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--text-2); font: inherit; font-size: 12px; cursor: pointer; box-shadow: var(--shadow-1); transition: border-color .2s, box-shadow .2s; }
.ai-pick-btn:hover { border-color: #d9dce3; box-shadow: var(--shadow-2); }
.ai-pick-btn b { font-weight: 600; color: var(--text); }
.composer-hint .ai-pick-btn svg { flex: none; }
.ai-pick-btn svg:last-child { transform: rotate(-90deg); }
.ai-pop { position: absolute; bottom: calc(100% + 8px); left: 0; z-index: 40; width: 270px; padding: 10px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-3); display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--text); }
.ai-pop[hidden] { display: none; }
.ai-pop-h { font-weight: 600; padding: 2px 6px 6px; }
.ai-pop-l { font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); padding: 6px 6px 2px; }
.ai-opt { display: flex; align-items: center; gap: 9px; width: 100%; padding: 7px 8px; border: 0; border-radius: 8px; background: transparent; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.ai-opt:hover { background: var(--line-2); }
.ai-radio { width: 14px; height: 14px; border-radius: 50%; border: 1.5px solid #c7cbd4; flex: none; }
.ai-opt.on .ai-radio { border: 4px solid var(--accent); }
.ai-pop .input { width: 100%; height: 32px; }
.ai-pop-f { padding: 8px 6px 2px; }
.chat-hero { max-width: 640px; margin: 8vh auto 0; text-align: center; }
.chat-hero h2 { font-size: 26px; letter-spacing: -.025em; margin: 0 0 6px; }
.ideas { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 24px; text-align: left; }
.idea { text-align: left; line-height: 1.45; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; cursor: pointer; font-size: 13.5px; color: var(--text-2); transition: border-color .2s, transform .2s var(--ease), box-shadow .2s; }
.idea:hover { border-color: var(--accent); color: var(--text); transform: translateY(-1px); box-shadow: var(--shadow-2); }
.chat-right { border-left: 1px solid var(--line); background: var(--surface); padding: 14px 12px; overflow-y: auto; }
.bk-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.bk-list li { display: flex; align-items: center; gap: 4px; padding: 7px 6px; border-radius: 9px; }
.bk-list li:hover { background: var(--line-2); }
pre.diff { background: #0f1220; color: #c9cddc; border-radius: 12px; padding: 12px 0; font-size: 12px; max-height: 60vh; overflow: auto; margin: 0; }
pre.diff div { padding: 0 14px; white-space: pre; }
pre.diff .add { background: rgba(16, 185, 129, .16); color: #a7f3d0; }
pre.diff .del { background: rgba(244, 63, 94, .16); color: #fecdd3; }
pre.diff .hunk { color: #a5b4fc; }
@media (max-width: 1100px) { .chat-wrap.with-right { grid-template-columns: 240px minmax(0, 1fr); } .chat-right { display: none; } }
@media (max-width: 900px) {
  .page.chatpage { height: calc(100dvh - 59px); }
  .chat-wrap, .chat-wrap.with-right { grid-template-columns: 1fr; }
  .chat-side { display: none; }
  .ideas { grid-template-columns: 1fr; }
  .msg.user .bubble { max-width: 90%; }
}
.chat-right .card-h svg { width: 16px; height: 16px; stroke: var(--text-2); flex: none; }
.chat-right .card-h .tools svg { stroke: currentColor; }

/* ---------- tools ---------- */
.tools-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 12px; padding: 0 20px 18px; }
.tool-tile { width: 100%; display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; text-align: left; transition: border-color .2s, box-shadow .25s var(--ease), transform .25s var(--ease); min-width: 0; }
.tool-tile:hover { border-color: #d6d9e0; box-shadow: var(--shadow-2); transform: translateY(-1px); }
.tool-tile > svg { width: 16px; height: 16px; stroke: var(--muted); flex: none; }
.tool-tile .badge svg { display: none; }
.tool-ico { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; flex: none; background: linear-gradient(135deg, #0ea5e9, var(--accent)); box-shadow: 0 8px 18px -10px var(--accent); }
.tool-ico svg { width: 20px; height: 20px; stroke: #fff; }
.steps-setup { display: flex; flex-direction: column; gap: 10px; }
.setup-step { display: flex; align-items: center; gap: 14px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); }
.setup-step .num { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; flex: none; font-size: 12.5px; font-weight: 700; color: var(--accent); background: var(--accent-soft); }
.auto-setup { margin-top: 10px; }
.auto-setup .ico { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; flex: none; background: var(--accent-soft); }
.auto-setup .ico svg { width: 17px; height: 17px; stroke: var(--accent); }
.auto-setup > .btn { flex: none; white-space: nowrap; }
.auto-setup code, .dl-steps code { white-space: nowrap; }
@media (max-width: 600px) { .auto-setup { flex-wrap: wrap; } .auto-setup > .btn { width: 100%; justify-content: center; } }
.setup-step code, .field code { font-size: 12px; background: var(--line-2); padding: 1px 6px; border-radius: 5px; }
.keybox { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12.5px; padding: 9px 12px; border-radius: 10px; background: #0f1220; color: #c7d2fe; letter-spacing: .02em; }
.dl-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.dl-card { display: flex; flex-direction: column; gap: 12px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface-2); min-width: 0; }
.dl-card > .btn { align-self: flex-start; margin-top: auto; }
.dl-card code { font-size: 12px; background: var(--line-2); padding: 1px 6px; border-radius: 5px; }
.dl-head { display: flex; align-items: center; gap: 12px; }
.dl-logo { width: 36px; height: 36px; border-radius: 50%; flex: none; }
.dl-logo.chrome { background: conic-gradient(from -60deg, #ea4335 0 120deg, #fbbc05 0 240deg, #34a853 0); box-shadow: inset 0 0 0 8px transparent; position: relative; }
.dl-logo.chrome::after { content: ''; position: absolute; inset: 10px; border-radius: 50%; background: #4285f4; box-shadow: 0 0 0 3px #fff; }
.dl-logo.firefox { background: radial-gradient(circle at 60% 40%, #ffbd4f 0 25%, #ff7139 45%, #e31587 75%, #9059ff 100%); }
.dl-steps { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--text-2); }
@media (max-width: 700px) { .dl-grid { grid-template-columns: 1fr; } }
@media (max-width: 900px) { .tools-grid { grid-template-columns: 1fr; padding: 0 14px 14px; } }

/* ---------- AI board (Overview): size = importance, chosen by the AI ---------- */
.board-headline { display: flex; align-items: flex-start; gap: 12px; margin: 6px 0 10px; font-size: 26px; line-height: 1.25; font-weight: 700; letter-spacing: -.02em; max-width: 980px; }
.board-sec { margin-bottom: 26px; }
.board-sec > h3 { margin: 0 0 10px; font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.board-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 14px; }
.bcard { position: relative; grid-column: span 4; display: flex; flex-direction: column; gap: 8px; padding: 16px 18px; min-width: 0;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-1);
  animation: rise .35s var(--ease) both; transition: box-shadow .2s, transform .2s, border-color .2s; }
.bcard.click { cursor: pointer; }
.bcard.click:hover { box-shadow: var(--shadow-2); transform: translateY(-1px); }
.bcard.wide { grid-column: span 6; }
.bcard.hero { grid-column: span 12; padding: 22px 26px; gap: 10px; box-shadow: var(--shadow-2); }
.bcard::before { content: ''; position: absolute; left: 0; top: 14px; bottom: 14px; width: 3px; border-radius: 0 3px 3px 0; background: transparent; }
.bcard.tone-urgent { border-color: #f6c9d4; background: linear-gradient(180deg, var(--bad-soft), var(--surface) 70%); }
.bcard.tone-urgent::before { background: var(--bad); }
.bcard.tone-warn::before { background: #f59e0b; }
.bcard.tone-good::before { background: var(--ok); }
.bcard.tone-good.hero { background: linear-gradient(180deg, var(--ok-soft), var(--surface) 70%); }
.bcard.tone-quiet { background: var(--surface-2); box-shadow: none; }
.bc-top { display: flex; align-items: center; gap: 8px; min-width: 0; }
.bc-ico { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; background: var(--line-2); color: var(--text-2); flex: none; }
.bc-ico svg { width: 15px; height: 15px; stroke: currentColor; }
.tone-urgent .bc-ico { background: var(--bad); color: #fff; }
.tone-warn .bc-ico { background: var(--warn-soft); color: var(--warn); }
.tone-good .bc-ico { background: var(--ok-soft); color: var(--ok); }
.bc-title { margin: 0; font-size: 14.5px; font-weight: 600; letter-spacing: -.01em; line-height: 1.35; overflow-wrap: anywhere; }
.hero .bc-title { font-size: 21px; line-height: 1.3; }
.bc-note { margin: 0; color: var(--text-2); font-size: 13.5px; }
.hero .bc-note { font-size: 15px; color: var(--text); }
.bc-value { font-size: 22px; font-weight: 700; letter-spacing: -.02em; }
.hero .bc-value { font-size: 30px; }
.bc-detail { color: var(--muted); font-size: 12.5px; overflow-wrap: anywhere; }
.bc-detail.clamp { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.bc-act { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; padding-top: 4px; }
.bc-act svg { width: 14px; height: 14px; }
.bc-tools { position: absolute; top: 12px; right: 12px; display: flex; align-items: center; gap: 4px; }
.bc-t { width: 26px; height: 26px; border: 0; border-radius: 7px; background: transparent; color: var(--muted); cursor: pointer; display: grid; place-items: center; }
.bc-t:hover { background: var(--line-2); color: var(--text); }
.bc-t.on { color: var(--accent); opacity: 1; }
.bc-t svg { width: 14px; height: 14px; stroke: currentColor; }
.bc-metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.bc-metrics .v { font-size: 20px; font-weight: 700; letter-spacing: -.02em; display: flex; align-items: center; gap: 4px; }
.hero .bc-metrics .v { font-size: 30px; }
.bc-metrics .k { font-size: 11.5px; color: var(--muted); }
.bc-metrics .up { color: var(--ok); } .bc-metrics .down { color: var(--bad); }
.bc-biz .spark { margin-top: 6px; }
.bc-prog { display: flex; align-items: center; gap: 12px; }
.bc-prog .bar { flex: 1; height: 10px; border-radius: 999px; background: var(--line-2); overflow: hidden; }
.bc-prog .bar i { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--accent), #7c3aed); transition: width .6s var(--ease); }
.bc-task { display: flex; flex-direction: column; gap: 8px; }
.bc-list { list-style: none; margin: 0; padding: 0; }
.bc-list li { display: grid; grid-template-columns: minmax(0, 160px) minmax(0, 1fr) auto; gap: 10px; padding: 6px 0; border-top: 1px solid var(--line-2); font-size: 13px; }
.bc-list li:first-child { border-top: 0; }
.board-also { display: flex; flex-wrap: wrap; gap: 8px; }
.also-chip { display: inline-flex; align-items: center; gap: 7px; max-width: 360px; padding: 6px 6px 6px 10px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); font-size: 12.5px; color: var(--text-2); transition: border-color .2s, color .2s; }
.also-chip:hover { border-color: var(--accent); color: var(--text); }
.also-chip svg { width: 13px; height: 13px; stroke: currentColor; flex: none; }
.also-chip b { font-weight: 600; color: var(--text); }
.chip-x { width: 20px; height: 20px; border: 0; border-radius: 50%; background: var(--line-2); color: var(--muted); display: grid; place-items: center; cursor: pointer; flex: none; }
.chip-x:hover { background: var(--accent-soft); color: var(--accent); }
.nav a.nav-urgent { color: var(--bad); }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@media (max-width: 1100px) { .bcard { grid-column: span 6; } .bcard.wide { grid-column: span 12; } }
@media (max-width: 700px) {
  .board-grid { gap: 10px; }
  .bcard, .bcard.wide, .bcard.hero { grid-column: span 12; }
  .bcard.hero { padding: 18px; }
  .board-headline { font-size: 21px; }
  .hero .bc-title { font-size: 18px; }
  .bc-metrics .v, .hero .bc-metrics .v { font-size: 18px; }
  .bc-list li { grid-template-columns: minmax(0, 1fr) auto; } .bc-list li .muted.ell { display: none; }
}
.bcard.hero.half { grid-column: span 6; }
.bc-detail.clamp3 { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
@media (max-width: 1100px) { .bcard.hero.half { grid-column: span 12; } }

/* ---------- board v2: language, ask bar, card chat, drawer ---------- */
.lang-pick { position: relative; display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 28px 0 10px; border-radius: 10px;
  background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-1); color: var(--text-2); cursor: pointer; transition: border-color .2s, box-shadow .2s; }
.lang-pick:hover { border-color: #d9dce3; box-shadow: var(--shadow-2); }
.lang-pick:focus-within { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-ring); }
.lang-pick svg { width: 16px; height: 16px; stroke: currentColor; flex: none; }
.lang-pick select { appearance: none; border: 0; background: transparent; font-weight: 500; font-size: 13px; color: var(--text); cursor: pointer; outline: none; padding: 0; }
.lang-pick .lang-chev { position: absolute; right: 9px; width: 13px; height: 13px; transform: rotate(90deg); pointer-events: none; color: var(--muted); }

.board-head { margin: 2px 0 26px; }
.board-kicker { display: flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 500; color: var(--muted); }
.board-kicker .sep { width: 3px; height: 3px; border-radius: 50%; background: currentColor; opacity: .6; }
.board-headline { gap: 14px; margin: 10px 0 12px; font-size: 28px; line-height: 1.22; letter-spacing: -.025em; text-wrap: balance; }
.mood-dot { flex: none; position: relative; margin-top: 12px; width: 10px; height: 10px; border-radius: 50%; background: var(--ok); }
.mood-dot.busy { background: #f59e0b; } .mood-dot.urgent { background: var(--bad); }
.mood-dot::after { content: ""; position: absolute; inset: -5px; border-radius: 50%; background: inherit; opacity: .25; animation: halo 2.4s var(--ease) infinite; }
@keyframes halo { 0% { transform: scale(.6); opacity: .35; } 100% { transform: scale(1.8); opacity: 0; } }
.board-meta { display: flex; align-items: center; gap: 6px; }
.meta-ai { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); }
.meta-ai svg { width: 14px; height: 14px; stroke: var(--accent); }

.home-chat { margin-top: 18px; }
.hc-bar { display: flex; align-items: center; gap: 10px; height: 52px; padding: 0 8px 0 16px; border-radius: 14px; background: var(--surface);
  border: 1px solid var(--line); box-shadow: var(--shadow-1); transition: border-color .2s var(--ease), box-shadow .25s var(--ease); }
.hc-bar:hover { box-shadow: var(--shadow-2); }
.hc-bar:focus-within { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-ring), var(--shadow-2); }
.hc-ico svg { width: 18px; height: 18px; stroke: var(--accent); display: block; }
.hc-input { flex: 1; min-width: 0; height: 100%; border: 0; outline: none; background: transparent; font-size: 15px; color: var(--text); }
.hc-input::placeholder { color: var(--muted); }
.hc-kbd { opacity: .8; }
.hc-bar:focus-within .hc-kbd { display: none; }
.hc-send { flex: none; width: 38px; height: 38px; border: 0; border-radius: 11px; display: grid; place-items: center; cursor: pointer; color: #fff;
  background: linear-gradient(135deg, var(--accent), #7c3aed); box-shadow: 0 6px 16px -8px var(--accent); transition: transform .15s var(--ease), box-shadow .2s; }
.hc-send:hover { transform: translateY(-1px); box-shadow: 0 10px 22px -10px var(--accent); }
.hc-send:active { transform: scale(.96); }
.hc-send svg { width: 16px; height: 16px; stroke: currentColor; }
.hc-ideas { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.hc-idea { height: 30px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--text-2); font-size: 12.5px; cursor: pointer; transition: border-color .2s, color .2s, background .2s; }
.hc-idea:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }

/* card tools: chat always there, teaching tools on hover */
.bc-teach { display: flex; gap: 2px; opacity: 0; transform: translateX(6px); transition: opacity .18s var(--ease), transform .18s var(--ease); }
.bcard:hover .bc-teach, .bcard:focus-within .bc-teach { opacity: 1; transform: none; }
.bc-chat { width: 32px; height: 32px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--accent); display: grid; place-items: center; cursor: pointer;
  box-shadow: var(--shadow-1); transition: background .18s, color .18s, transform .15s var(--ease), box-shadow .2s; }
.bc-chat:hover { background: var(--accent); color: #fff; border-color: transparent; transform: translateY(-1px); box-shadow: 0 8px 18px -10px var(--accent); }
.bc-chat svg { width: 16px; height: 16px; stroke: currentColor; }
.bc-top { padding-right: 132px; }
.bcard.pinned { box-shadow: 0 0 0 1px var(--accent-ring), var(--shadow-2); }
.bcard.pinned .bc-teach { opacity: 1; transform: none; }
.bcard .bc-act { padding-top: 6px; }

/* drawer */
.dock-scrim { position: fixed; inset: 0; z-index: 60; background: rgba(15, 18, 30, .12); opacity: 0; pointer-events: none; transition: opacity .25s var(--ease); }
body.dock-open .dock-scrim { opacity: 1; pointer-events: auto; }
.dock { position: fixed; z-index: 61; top: 12px; right: 12px; bottom: 12px; width: min(440px, calc(100vw - 24px)); display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow-3);
  transform: translateX(calc(100% + 24px)); transition: transform .32s var(--ease); }
.dock.open { transform: none; }
.dock-head { display: flex; align-items: center; gap: 10px; padding: 14px 12px 12px 16px; border-bottom: 1px solid var(--line-2); }
.dock-head b { font-size: 14.5px; display: block; }
.dock-av { width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; flex: none; background: linear-gradient(135deg, var(--accent), #7c3aed); color: #fff; }
.dock-av svg { width: 17px; height: 17px; stroke: currentColor; }
.dock-ctx { display: flex; gap: 6px; padding: 10px 16px 0; }
.dock-chip { display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 9px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-size: 12px; font-weight: 600; }
.dock-chip svg { width: 13px; height: 13px; stroke: currentColor; }
.dock-list { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 12px; scroll-behavior: smooth; }
.dm { max-width: 92%; font-size: 14px; line-height: 1.55; animation: rise .25s var(--ease) both; overflow-wrap: anywhere; }
.dm.user { align-self: flex-end; padding: 9px 13px; border-radius: 14px 14px 4px 14px; background: var(--accent); color: #fff; }
.dm.ai { align-self: flex-start; padding: 10px 14px; border-radius: 14px 14px 14px 4px; background: var(--surface-2); border: 1px solid var(--line-2); }
.dm.ai.err { color: var(--bad); background: var(--bad-soft); }
.dm .md > :first-child { margin-top: 0; } .dm .md > :last-child { margin-bottom: 0; }
.dm-step { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.spin-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); animation: pulse 1.2s infinite; }
.typing { display: inline-flex; gap: 4px; padding: 4px 0; }
.typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--muted); animation: blink 1.2s infinite both; }
.typing i:nth-child(2) { animation-delay: .15s; } .typing i:nth-child(3) { animation-delay: .3s; }
@keyframes blink { 0%, 80%, 100% { opacity: .25; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-2px); } }
.dock-empty { margin: auto; text-align: center; display: grid; gap: 6px; justify-items: center; color: var(--text-2); }
.dock-empty .ico { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.dock-empty .ico svg { width: 20px; height: 20px; stroke: currentColor; }
.dock-foot { display: flex; align-items: flex-end; gap: 8px; padding: 12px; border-top: 1px solid var(--line-2); }
.dock-input { flex: 1; resize: none; min-height: 40px; max-height: 140px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; outline: none; font-size: 14px; line-height: 1.4; background: var(--surface-2); transition: border-color .2s, box-shadow .2s, background .2s; }
.dock-input:focus { border-color: var(--accent); background: var(--surface); box-shadow: 0 0 0 4px var(--accent-ring); }

@media (max-width: 700px) {
  .top .search-btn { min-width: 0; }
  .top .search-btn span, .top .search-btn kbd { display: none; }
  .lang-pick { height: 40px; }
  .board-headline { font-size: 22px; }
  .hc-bar { height: 50px; }
  .hc-kbd { display: none; }
  .bc-teach { opacity: 1; transform: none; }
  .bc-t { width: 36px; height: 36px; }
  .bc-chat { width: 40px; height: 40px; }
  .bc-top { padding-right: 168px; }
  .dock { top: auto; left: 0; right: 0; bottom: 0; width: 100%; height: 86vh; border-radius: 20px 20px 0 0; transform: translateY(100%); }
  .dock.open { transform: none; }
}
@media (prefers-reduced-motion: reduce) { .mood-dot::after { display: none; } }
.main { overflow-x: clip; }
@media (max-width: 700px) {
  .page .btn.sm, .hc-idea, .also-chip { min-height: 40px; }
  .bc-t { width: 40px; height: 40px; }
  .chip-x { width: 32px; height: 32px; }
  .hc-send { width: 40px; height: 40px; }
  .bc-top { padding-right: 180px; }
}
.board.calm .bcard, .board.calm .dm { animation: none; }
.section-label { margin: 0 0 10px; font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }

/* ---------- Tasks page: everything that runs on its own ---------- */
.tk-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 20px; }
.tk-stat .value { font-size: 24px; }
.tk-stat.bad .value { color: var(--bad); }
.tk-stat .label .dot { margin-right: 1px; }
.tk-tools { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
.tk-search { flex: 1; max-width: 360px; height: 38px; }
.tk-group { margin-bottom: 22px; animation: rise .35s var(--ease) both; }
.tk-gh { display: flex; align-items: center; gap: 8px; width: 100%; border: 0; background: none; padding: 0 4px 9px; font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); cursor: pointer; text-align: left; }
.tk-gh .grow { flex: 1; }
.tk-gh .badge { letter-spacing: 0; text-transform: none; }
.tk-n { font-size: 11px; padding: 1px 7px; border-radius: 999px; background: var(--line-2); color: var(--text-2); letter-spacing: 0; }
.tk-chev { width: 15px; height: 15px; stroke: currentColor; transform: rotate(90deg); transition: transform .2s var(--ease); }
.tk-group.closed .tk-chev { transform: rotate(0deg); }
.tk-group.closed .tk-rows { display: none; }
.tk-rows { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-1); overflow: hidden; }
.tk-group.attn .tk-rows { border-color: #f6c9d4; }
.tk-row { display: grid; grid-template-columns: 34px minmax(180px, 1fr) 150px 190px 132px 160px; gap: 16px; align-items: center;
  padding: 13px 16px; border-top: 1px solid var(--line-2); cursor: pointer; transition: background .15s; outline: none; }
.tk-row:first-child { border-top: 0; }
.tk-row:hover, .tk-row:focus-visible { background: var(--surface-2); }
.tk-row:focus-visible { box-shadow: inset 0 0 0 2px var(--accent-ring); }
.tk-row.attn { box-shadow: inset 3px 0 0 var(--bad); }
.tk-row.running { box-shadow: inset 3px 0 0 var(--ok); }
.tk-ico { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; flex: none; }
.tk-ico svg { width: 16px; height: 16px; stroke: currentColor; }
.tk-ico.task { background: linear-gradient(135deg, var(--accent), #7c3aed); color: #fff; box-shadow: 0 6px 14px -8px var(--accent); }
.tk-ico.workflow { background: var(--accent-soft); color: var(--accent); }
.tk-ico.system { background: var(--line-2); color: var(--text-2); }
.tk-ico.big { width: 46px; height: 46px; border-radius: 14px; }
.tk-ico.big svg { width: 21px; height: 21px; }
.tk-name { min-width: 0; }
.tk-name b { display: block; font-size: 14px; }
.tk-sub { display: flex; gap: 6px; align-items: center; margin-top: 2px; font-size: 12.5px; color: var(--muted); }
.tk-sub .badge { height: 19px; }
.tk-fix { margin-top: 5px; font-size: 12.5px; color: var(--bad); max-width: 100%; }
.tk-when b { font-size: 13px; font-weight: 600; white-space: nowrap; }
.tk-tick { font-weight: 600; color: var(--accent); }
.tk-live { display: inline-flex; align-items: center; gap: 6px; color: var(--ok); font-weight: 600; }
.tk-hist { display: flex; gap: 2px; align-items: flex-end; }
.tk-hist i { width: 6px; height: 18px; border-radius: 2px; background: var(--ok); opacity: .85; transition: transform .15s var(--ease), opacity .15s; transform-origin: bottom; }
.tk-hist i:hover { transform: scaleY(1.3); opacity: 1; }
.tk-hist i.f { background: var(--bad); } .tk-hist i.s { background: #c7cbd3; } .tk-hist i.e { background: var(--line-2); }
.tk-mini { display: flex; align-items: center; gap: 10px; white-space: nowrap; }
.tk-mini .bar { flex: 1; min-width: 70px; height: 7px; border-radius: 999px; background: var(--line-2); overflow: hidden; }
.tk-mini .bar i { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--accent), #7c3aed); transition: width .6s var(--ease); }
.tk-acts { display: flex; align-items: center; gap: 4px; justify-content: flex-end; }
.tk-ib { width: 32px; height: 32px; border-radius: 9px; border: 1px solid var(--line); background: var(--surface); color: var(--text-2); display: grid; place-items: center; cursor: pointer; opacity: 0; transform: translateX(4px);
  transition: opacity .15s var(--ease), transform .15s var(--ease), background .15s, color .15s, border-color .15s; }
.tk-ib svg { width: 14px; height: 14px; stroke: currentColor; }
.tk-row:hover .tk-ib, .tk-row:focus-within .tk-ib { opacity: 1; transform: none; }
.tk-ib:hover { background: var(--accent); color: #fff; border-color: transparent; }
.tk-go { color: var(--muted); display: grid; place-items: center; width: 20px; }
.tk-go svg { width: 16px; height: 16px; stroke: currentColor; }

/* inspector */
.insp-scrim { position: fixed; inset: 0; z-index: 55; background: rgba(15, 18, 30, .12); opacity: 0; pointer-events: none; transition: opacity .25s var(--ease); }
body.insp-open .insp-scrim { opacity: 1; pointer-events: auto; }
.insp { position: fixed; z-index: 56; top: 12px; right: 12px; bottom: 12px; width: min(620px, calc(100vw - 24px)); overflow-y: auto; background: var(--surface); border: 1px solid var(--line);
  border-radius: 18px; box-shadow: var(--shadow-3); transform: translateX(calc(100% + 24px)); transition: transform .32s var(--ease); }
.insp.open { transform: none; }
.insp-body { padding: 22px 24px 26px; display: flex; flex-direction: column; gap: 16px; animation: rise .3s var(--ease) both; }
.insp-body.calm { animation: none; }
.insp-h { display: flex; gap: 14px; align-items: flex-start; }
.insp-h h2 { margin: 0; font-size: 20px; letter-spacing: -.02em; line-height: 1.3; }
.insp-h p { margin: 4px 0 8px; font-size: 13px; }
.insp-acts { display: flex; flex-wrap: wrap; gap: 6px; }
.insp-acts svg { width: 14px; height: 14px; }
.tk-err { align-items: flex-start; }
.insp-grid { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 14px; align-items: start; }
.insp-panel { border: 1px solid var(--line-2); border-radius: 14px; padding: 14px 16px; background: var(--surface-2); min-width: 0; }
.insp-panel h4 { margin: 0 0 10px; font-size: 11.5px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.tk-dial { position: relative; display: grid; place-items: center; }
.tk-dial-c { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.tk-dial-c b { font-size: 16px; }
.tk-dial-c .tk-tick { color: var(--text); }
.tk-kv { display: grid; grid-template-columns: auto 1fr; gap: 5px 12px; margin: 12px 0 0; font-size: 12.5px; }
.tk-kv dt { color: var(--muted); } .tk-kv dd { margin: 0; overflow-wrap: anywhere; }
.tk-people { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 6px; }
.tk-p { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 10px; background: var(--surface); border: 1px solid var(--line-2); font-size: 12.5px; min-width: 0; }
.tk-p .badge { margin-left: auto; height: 20px; }
.tk-av { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-size: 10.5px; font-weight: 700; flex: none; }
.tk-runs { list-style: none; margin: 10px 0 0; padding: 0; }
.tk-runs li { display: flex; align-items: center; gap: 10px; padding: 7px 0; border-top: 1px solid var(--line); font-size: 12.5px; min-width: 0; }
.tk-runs li:first-child { border-top: 0; }
.tk-runs time { color: var(--muted); white-space: nowrap; width: 92px; flex: none; }
.tk-runs .ell { flex: 1; }

@media (max-width: 1100px) {
  .tk-row { grid-template-columns: 34px minmax(0, 1fr) 150px 160px; }
  .tk-trend, .tk-state { display: none; }
}
@media (max-width: 700px) {
  .tk-stats { grid-template-columns: 1fr 1fr; }
  .tk-row { grid-template-columns: 34px minmax(0, 1fr) auto; gap: 12px; }
  .tk-when { grid-column: 2; grid-row: 2; }
  .tk-acts { grid-row: 1 / span 2; grid-column: 3; }
  .tk-ib { opacity: 1; transform: none; width: 40px; height: 40px; }
  .tk-acts .tk-ib:not(:first-child) { display: none; }
  .insp { top: auto; left: 0; right: 0; bottom: 0; width: 100%; height: 90vh; border-radius: 20px 20px 0 0; transform: translateY(100%); }
  .insp-grid { grid-template-columns: 1fr; }
}

/* language pill: the select itself covers the whole pill, icons never take the click */
.lang-pick { padding: 0; gap: 0; }
.lang-pick > svg { position: absolute; left: 10px; pointer-events: none; }
.lang-pick select { height: 100%; padding: 0 30px 0 34px; border-radius: 10px; }
.lang-pick select:focus-visible { outline: none; }
/* approve in place: paste field(s) + actions */
.bc-paste-row { display: flex; gap: 6px; flex: 1 1 100%; min-width: 0; }
.bc-paste { flex: 1; min-width: 0; height: 32px; font-size: 13px; }
.dock-ideas { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin-top: 10px; max-width: 340px; }

/* Entrance animations run only in a visible window: a background tab pauses them on their first, invisible frame. */
html:not(.anim) :is(.page, .approval, .pipe li, .stagger > *, .msg, .orb-lg, .action-card, .bcard, .dm, .tk-group, .insp-body, .login .card, .feed li.new) { animation: none; }
html:not(.anim) .fade-area { opacity: 1; animation: none; }
html:not(.anim) .draw { stroke-dashoffset: 0; animation: none; }
.tk-today { margin-top: 6px; gap: 4px; align-items: center; }
.tk-today .badge { height: 20px; }
.tk-tech { margin-top: 8px; font-size: 12px; color: var(--muted); }
.tk-tech summary { cursor: pointer; }
.tk-tech code { display: block; margin-top: 4px; white-space: pre-wrap; overflow-wrap: anywhere; color: var(--text-2); }

.tk-dial-c b { font-size: 22px; }
.tk-dial-c .small { color: var(--accent); font-weight: 600; max-width: 110px; line-height: 1.3; }
.tk-dial-c .small .tk-tick { color: inherit; }
.tk-p.why { flex-wrap: wrap; grid-column: 1 / -1; }
.tk-why { flex: 1 1 100%; padding-left: 30px; font-size: 12px; color: var(--text-2); line-height: 1.45; }

/* Inside the Android app: its native bar opens the menu and runs search-free navigation. */
.in-app .menu-btn, .in-app .search-btn { display: none; }
.qr { width: 220px; max-width: 100%; padding: 8px; background: #fff; border: 1px solid var(--line); border-radius: 12px; }
.qr svg { display: block; width: 100%; height: auto; }
