/* Influential uses Focus's design system (Forest theme), copied from focus-deterministic/web/app.css. Keep in sync. */

:root {
  --bg: #fbfaf7;
  --side: #f3f1ec;
  --surface: #ffffff;
  --surface-2: #f7f5f0;
  --hover: rgba(31, 36, 33, 0.045);
  --selected: rgba(31, 36, 33, 0.07);
  --line: #e7e3da;
  --line-strong: #d8d3c7;
  --fg: #1f2421;
  --fg-2: #4b524c;
  --fg-3: #7b817a;
  --fg-4: #a3a69f;
  --accent: #17704a;
  --accent-hover: #115a3b;
  --accent-soft: #e6f2ec;
  --accent-ring: rgba(23, 112, 74, 0.22);
  --ok: #17704a;
  --ok-soft: #e6f2ec;
  --warn: #9a5b06;
  --warn-soft: #fbf0dc;
  --bad: #b4321b;
  --bad-soft: #fcebe5;
  --info: #2a5f8f;
  --info-soft: #e7f0f8;
  --ink: #1f2421;
  --on-ink: #fbfaf7;
  --radius-sm: 6px;
  --radius: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --shadow-sm: 0 1px 2px rgba(31, 36, 33, 0.05);
  --shadow: 0 1px 2px rgba(31, 36, 33, 0.05), 0 6px 20px rgba(31, 36, 33, 0.06);
  --shadow-lg: 0 10px 40px rgba(31, 36, 33, 0.14), 0 2px 8px rgba(31, 36, 33, 0.06);
  --sidebar-w: 236px;
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 400 14px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "cv11", "ss01";
}
h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -0.012em; color: var(--fg); }
p { margin: 0; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
code, pre, kbd { font-family: var(--mono); font-size: 12px; }
.ti { font-size: 18px; line-height: 1; }
::selection { background: var(--accent-soft); }

/* ---------- Controls ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 34px;
  padding: 0 14px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--fg);
  font: 500 13px/1 var(--font);
  white-space: nowrap;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: background .12s, border-color .12s, box-shadow .12s, color .12s;
}
.btn .ti { font-size: 16px; }
.btn:hover { background: var(--surface-2); }
.btn:focus-visible, .icon-btn:focus-visible, .nav a:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--accent-ring); }
.btn:disabled { opacity: .55; cursor: default; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn-ink { background: var(--ink); border-color: var(--ink); color: var(--on-ink); }
.btn-ink:hover { background: #343b36; }
.btn-ghost { background: transparent; border-color: transparent; box-shadow: none; color: var(--fg-2); }
.btn-ghost:hover { background: var(--hover); }
.btn-danger { color: var(--bad); }
.btn-danger:hover { background: var(--bad-soft); border-color: #f1c6b9; }
.btn-sm { height: 28px; padding: 0 10px; font-size: 12.5px; }
.btn-block { width: 100%; }
.btn-link { height: auto; padding: 0; border: 0; background: none; box-shadow: none; color: var(--fg-3); font-weight: 400; text-decoration: underline; }
.btn-link:hover { background: none; color: var(--fg); }
.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: var(--radius);
  background: transparent;
  color: var(--fg-3);
  cursor: pointer;
}
.icon-btn:hover { background: var(--hover); color: var(--fg); }

input, select, textarea {
  width: 100%;
  min-height: 36px;
  padding: 8px 11px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--fg);
  font: 400 14px/1.4 var(--font);
  transition: border-color .12s, box-shadow .12s;
}
textarea { resize: vertical; line-height: 1.5; }
input::placeholder, textarea::placeholder { color: var(--fg-4); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring); }
select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 32px;
  background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%237b817a' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m7 10 5 5 5-5'/%3E%3C/svg%3E") no-repeat right 10px center;
}
input[type="checkbox"] { width: 16px; height: 16px; min-height: 0; padding: 0; accent-color: var(--accent); }
.field { display: grid; gap: 6px; font-size: 13px; font-weight: 500; color: var(--fg-2); }
.field small { font-weight: 400; color: var(--fg-3); }
.check { display: flex; align-items: center; gap: 9px; font-size: 13.5px; color: var(--fg-2); }
.pref-row { align-items: flex-start; padding: 4px 0; }
.pref-row span { display: grid; gap: 4px; }
.pref-row strong { color: var(--fg); font-weight: 600; }
.stack { display: grid; gap: 14px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.hint { font-size: 12.5px; color: var(--fg-3); line-height: 1.5; }
.form-error { margin-top: 10px; font-size: 13px; color: var(--bad); }
.select-sm { width: auto; min-height: 28px; height: 28px; padding: 0 28px 0 9px; font-size: 12.5px; background-position: right 7px center; }

/* ---------- Pills, avatars, dots ---------- */
.pill { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 9px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); color: var(--fg-2); font-size: 12px; font-weight: 500; white-space: nowrap; }
.pill-ok { background: var(--ok-soft); border-color: transparent; color: var(--ok); }
.pill-warn { background: var(--warn-soft); border-color: transparent; color: var(--warn); }
.pill-bad { background: var(--bad-soft); border-color: transparent; color: var(--bad); }
.pill-info { background: var(--info-soft); border-color: transparent; color: var(--info); }
.pill-ink { background: var(--ink); border-color: var(--ink); color: var(--on-ink); }
.pill-pro { background: var(--accent-soft); border-color: transparent; color: var(--accent); font-weight: 600; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--fg-4); flex: none; }
.dot-ok { background: #1f9d63; box-shadow: 0 0 0 3px rgba(31, 157, 99, .14); }
.dot-warn { background: #d08a1a; box-shadow: 0 0 0 3px rgba(208, 138, 26, .14); }
.dot-bad { background: #d24a2c; box-shadow: 0 0 0 3px rgba(210, 74, 44, .14); }
.avatar { width: 32px; height: 32px; flex: none; border-radius: 50%; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); font-size: 12px; font-weight: 600; text-transform: uppercase; overflow: hidden; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar-sm { width: 26px; height: 26px; font-size: 10.5px; }
.avatar-ghost { background: transparent; border: 1px dashed var(--line-strong); color: var(--fg-3); }
.avatar-ink { background: var(--ink); color: var(--on-ink); }
.brand-logo { width: 24px; height: 24px; flex: none; display: block; }
.brand-mark { width: 24px; height: 24px; flex: none; border-radius: 7px; display: grid; place-items: center; background: var(--accent); color: #fff; font-size: 12px; font-weight: 600; }
.src-icon { width: 18px; height: 18px; flex: none; }

/* ---------- Gate (sign in, picker) ---------- */
.gate { min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px; background: var(--bg); }
.gate-card { width: min(400px, 100%); padding: 32px 28px 26px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-xl); box-shadow: var(--shadow); }
.gate-wide { width: min(480px, 100%); }
.brand { display: flex; align-items: center; gap: 9px; font-weight: 600; margin-bottom: 26px; }
.gate-card h1 { font-size: 22px; }
.gate-note { margin: 6px 0 22px; color: var(--fg-3); font-size: 14px; }
.gate-hint { margin-top: 14px; padding: 10px 12px; border-radius: var(--radius); background: var(--accent-soft); color: var(--accent); font-size: 13px; }
.panel { padding: 18px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface-2); margin: 18px 0 8px; }
.panel h2 { font-size: 14.5px; }
.subhead { font-size: 13px; font-weight: 600; color: var(--fg-2); margin: 22px 0 8px; }
.callout { display: flex; gap: 12px; padding: 13px 14px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface-2); font-size: 13.5px; color: var(--fg-2); margin: 14px 0; }
.callout strong { display: block; color: var(--fg); font-weight: 600; margin-bottom: 2px; }
.callout-warn { background: var(--warn-soft); border-color: #f0dcae; color: #6a4204; }
.callout-warn strong { color: #5a3803; }
.callout .ti { font-size: 20px; color: var(--warn); }

/* ---------- App layout ---------- */
.app { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); min-height: 100dvh; }
.sidebar {
  position: sticky;
  top: 0;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px 10px;
  background: var(--side);
  border-right: 1px solid var(--line);
  overflow-y: auto;
}
.ws-switch {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 7px 8px;
  border: 0;
  border-radius: var(--radius);
  background: transparent;
  color: var(--fg);
  font: 600 14px/1.2 var(--font);
  cursor: pointer;
  text-align: left;
}
.ws-switch:hover { background: var(--hover); }
.ws-switch .ti { margin-left: auto; color: var(--fg-3); font-size: 16px; }
.ws-switch-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ws-switch .pill { flex: none; height: 18px; padding: 0 6px; font-size: 11px; }
.nav { display: grid; gap: 1px; }
.nav a, .nav-me {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 34px;
  padding: 0 10px;
  border: 0;
  border-radius: var(--radius);
  background: transparent;
  color: var(--fg-2);
  font: 500 13.5px/1 var(--font);
  text-decoration: none;
  cursor: pointer;
}
.nav a .ti { color: var(--fg-3); }
.nav a:hover, .nav-me:hover { background: var(--hover); text-decoration: none; }
.nav a.on { background: var(--surface); color: var(--fg); box-shadow: 0 0 0 1px var(--line), var(--shadow-sm); }
.nav a.on .ti { color: var(--accent); }
.nav .count { margin-left: auto; font-style: normal; font-size: 11.5px; font-weight: 600; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.nav-bottom { margin-top: auto; padding-top: 8px; border-top: 1px solid var(--line); }
.nav-me { width: 100%; height: 40px; text-align: left; }
.nav-me-email { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 400; color: var(--fg-2); }
.nav-me .ti { color: var(--fg-3); }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { display: none; }
.banner { margin: 16px 32px 0; padding: 11px 14px; border-radius: var(--radius); background: var(--bad-soft); color: var(--bad); font-size: 13.5px; }
.page { padding: 32px clamp(16px, 4vw, 40px) 64px; width: 100%; max-width: 1080px; margin: 0 auto; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 24px; }
.page-head h1 { font-size: 22px; }
.page-head p { margin-top: 5px; color: var(--fg-3); font-size: 14px; max-width: 62ch; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.section { margin-top: 30px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.section-head h2 { font-size: 14.5px; }
.section-head p { color: var(--fg-3); font-size: 13px; }

/* ---------- Cards, lists ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); }
.card-pad { padding: 18px; }
.rows { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-sm); }
.rows:empty { display: none; }
.rows > li { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-top: 1px solid var(--line); min-width: 0; }
.rows > li:first-child { border-top: 0; }
.rows > li.clickable { cursor: pointer; }
.rows > li.clickable:hover { background: var(--surface-2); }
.rows > li.selected { background: var(--accent-soft); }
.row-main { flex: 1; min-width: 0; }
.row-title { font-weight: 500; color: var(--fg); overflow: hidden; text-overflow: ellipsis; }
.row-title .muted { font-weight: 400; }
.row-sub { margin-top: 2px; font-size: 12.5px; color: var(--fg-3); overflow-wrap: anywhere; }
.row-desc { margin-top: 4px; font-size: 13px; color: var(--fg-2); }
.row-end { display: flex; align-items: center; gap: 8px; flex: none; }
.muted { color: var(--fg-3); }
.time { font-size: 12px; color: var(--fg-4); white-space: nowrap; }
.empty {
  display: grid;
  justify-items: center;
  gap: 8px;
  padding: 36px 20px;
  text-align: center;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-lg);
  color: var(--fg-3);
  background: var(--surface-2);
}
.empty .ti { font-size: 26px; color: var(--fg-4); }
.empty strong { color: var(--fg); font-weight: 600; }
.empty p { max-width: 46ch; font-size: 13.5px; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.stat { padding: 16px 18px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); }
.stat-label { font-size: 12.5px; color: var(--fg-3); font-weight: 500; display: flex; align-items: center; gap: 6px; }
.stat-value { margin-top: 6px; font-size: 26px; font-weight: 600; letter-spacing: -0.02em; }
.stat-sub { margin-top: 2px; font-size: 12.5px; color: var(--fg-3); }
.grid-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.tile { display: grid; gap: 12px; padding: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); }
.tile-head { display: flex; align-items: center; gap: 10px; font-weight: 600; }
.tile-head svg { width: 22px; height: 22px; }
.tile-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.seg { display: inline-flex; padding: 3px; gap: 2px; border-radius: 10px; background: #ece9e2; flex-wrap: wrap; }
.seg button { height: 28px; padding: 0 12px; border: 0; border-radius: 7px; background: transparent; color: var(--fg-3); font: 500 12.5px/1 var(--font); cursor: pointer; }
.seg button.on { background: var(--surface); color: var(--fg); box-shadow: var(--shadow-sm); }
.code { position: relative; margin: 0; padding: 12px 44px 12px 14px; border-radius: var(--radius); background: #1f2421; color: #e9ece7; font: 12.5px/1.6 var(--mono); white-space: pre-wrap; word-break: break-all; }
.code .copy { position: absolute; top: 6px; right: 6px; color: #b9bfb7; }
.code .copy:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.label-sm { font-size: 11.5px; font-weight: 600; color: var(--fg-3); text-transform: uppercase; letter-spacing: .05em; margin: 14px 0 6px; }
/* An import preview: lines added and removed. */
.diff { list-style: none; margin: 0 0 10px; padding: 8px 12px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface-2); font: 12.5px/1.6 var(--mono); overflow-wrap: anywhere; }
.diff .ok { color: var(--ok); }
.diff .bad { color: var(--bad); }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; font-size: 13px; }
.kv dt { color: var(--fg-3); }
.kv dd { margin: 0; overflow-wrap: anywhere; }

/* ---------- Home ---------- */
.greeting h1 { font-size: 26px; }
.waiting-item .row-title { font-weight: 400; color: var(--fg-2); }
.waiting-item .row-title strong { color: var(--fg); font-weight: 600; }

/* ---------- Chat (Iris, agents) ---------- */
.page-chat { max-width: none; padding: 0; height: 100dvh; display: grid; grid-template-columns: minmax(0, 1fr) auto; }
.chat-col { display: flex; flex-direction: column; min-width: 0; height: 100dvh; }
.chat-head { display: flex; align-items: center; gap: 10px; padding: 14px 24px; border-bottom: 1px solid var(--line); background: var(--bg); }
.chat-head h1 { font-size: 16px; }
.chat-head .grow { flex: 1; }
.chat-scroll { flex: 1; overflow-y: auto; padding: 28px 24px 12px; }
.chat-list { list-style: none; margin: 0 auto; padding: 0; max-width: 720px; display: grid; gap: 18px; }
.msg { display: flex; gap: 12px; min-width: 0; }
.msg-body { min-width: 0; flex: 1; line-height: 1.6; white-space: pre-wrap; overflow-wrap: anywhere; color: var(--fg); font-size: 14.5px; }
.msg-meta { font-size: 12px; color: var(--fg-4); margin-top: 4px; display: flex; gap: 8px; align-items: center; }
.msg-you { justify-content: flex-end; }
.msg-you .msg-body { flex: 0 1 auto; max-width: 80%; padding: 9px 14px; border-radius: 18px 18px 6px 18px; background: var(--accent); color: #fff; }
.msg-you .msg-meta { justify-content: flex-end; }
.msg-fail .msg-body { color: var(--bad); }
.msg-tool .msg-body { font: 12.5px/1.55 var(--mono); color: var(--fg-2); padding: 9px 12px; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius); }
.msg-kind { font-size: 11.5px; font-weight: 600; color: var(--fg-3); text-transform: uppercase; letter-spacing: .04em; margin-bottom: 3px; }
.thinking { display: inline-flex; gap: 4px; padding: 10px 0; }
.thinking i { width: 6px; height: 6px; border-radius: 50%; background: var(--fg-4); animation: blink 1.2s infinite both; }
.thinking i:nth-child(2) { animation-delay: .2s; }
.thinking i:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }
.ticks { display: inline-flex; gap: 1px; }
.ticks i { font-size: 13px; color: rgba(255, 255, 255, .85); }
.msg-meta .ticks i { color: var(--fg-4); }
.msg-meta .ticks i.read { color: var(--accent); }
.composer-wrap { padding: 10px 24px 20px; background: linear-gradient(transparent, var(--bg) 24%); }
.composer {
  max-width: 720px;
  margin: 0 auto;
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 8px 8px 8px 16px;
  border: 1px solid var(--line-strong);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: var(--shadow);
}
.composer:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring), var(--shadow); }
.composer textarea { flex: 1; min-height: 24px; max-height: 200px; padding: 6px 0; border: 0; box-shadow: none; background: transparent; resize: none; font-size: 14.5px; }
.composer textarea:focus { box-shadow: none; }
.send-btn { width: 34px; height: 34px; flex: none; border: 0; border-radius: 11px; background: var(--accent); color: #fff; display: grid; place-items: center; cursor: pointer; }
.send-btn:disabled { background: var(--line-strong); cursor: default; }
.composer-hint { max-width: 720px; margin: 6px auto 0; font-size: 11.5px; color: var(--fg-4); text-align: center; }
.chat-empty { max-width: 520px; margin: 12vh auto 0; text-align: center; display: grid; gap: 10px; justify-items: center; color: var(--fg-3); }
.chat-empty h2 { font-size: 20px; color: var(--fg); }
.suggestions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 8px; }
.suggestions button { height: auto; padding: 8px 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--fg-2); font: 400 13px/1.3 var(--font); cursor: pointer; }
.suggestions button:hover { border-color: var(--accent); color: var(--accent); }
.details { width: 340px; height: 100dvh; display: flex; flex-direction: column; border-left: 1px solid var(--line); background: var(--surface-2); }
.details-head { display: flex; align-items: center; gap: 8px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.details-head h2 { font-size: 14px; flex: 1; }
.details-body { flex: 1; overflow-y: auto; padding: 12px 16px 24px; }
.event-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.event-list li { display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; padding: 7px 8px; border-radius: var(--radius-sm); font-size: 12.5px; }
.event-list li:hover { background: var(--hover); }
.event-list time { color: var(--fg-4); font-variant-numeric: tabular-nums; }
.event-list .ev-tx { grid-column: 2; color: var(--fg-4); font: 11px var(--mono); }
.pipe-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.pipe-list li { padding: 9px 11px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); font-size: 12.5px; white-space: pre-wrap; overflow-wrap: anywhere; }
.pipe-list .pipe-kind { display: flex; gap: 6px; align-items: center; margin-bottom: 4px; font-size: 11.5px; font-weight: 600; color: var(--fg-3); }

/* Agents split */
.page-split { max-width: none; padding: 0; height: 100dvh; display: grid; grid-template-columns: 320px minmax(0, 1fr); }
.split-list { display: flex; flex-direction: column; min-height: 0; border-right: 1px solid var(--line); background: var(--surface-2); }
.split-list-head { padding: 22px 18px 12px; }
.split-list-head h1 { font-size: 20px; }
.split-list-head p { margin-top: 3px; font-size: 13px; color: var(--fg-3); }
.split-items { flex: 1; overflow-y: auto; padding: 4px 10px 16px; display: grid; gap: 2px; align-content: start; }
.split-item { display: grid; gap: 3px; width: 100%; padding: 10px 12px; border: 0; border-radius: var(--radius); background: transparent; text-align: left; cursor: pointer; color: var(--fg); font: inherit; }
.split-item:hover { background: var(--hover); }
.split-item.on { background: var(--surface); box-shadow: 0 0 0 1px var(--line), var(--shadow-sm); }
.split-item-title { display: flex; align-items: center; gap: 8px; font-weight: 500; overflow: hidden; }
.split-item-title span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.split-item-sub { padding-left: 16px; font-size: 12.5px; color: var(--fg-3); }

/* ---------- Sheet, dialog, menu, toast ---------- */
.sheet-layer { position: fixed; inset: 0; z-index: 50; }
.sheet-scrim, .scrim { position: fixed; inset: 0; background: rgba(31, 36, 33, .28); animation: fade .15s ease-out; }
.sheet {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(460px, 100vw);
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border-left: 1px solid var(--line);
  box-shadow: var(--shadow-lg);
  animation: slide-in .2s cubic-bezier(.2, .8, .2, 1);
}
.sheet-head { display: flex; align-items: center; gap: 10px; padding: 18px 20px 14px; border-bottom: 1px solid var(--line); }
.sheet-head h2 { flex: 1; font-size: 16px; }
.sheet-body { flex: 1; overflow-y: auto; padding: 18px 20px 28px; }
.sheet-body form { display: grid; gap: 14px; }
.sheet-actions { position: sticky; bottom: -28px; display: flex; gap: 8px; padding: 14px 0 0; margin-top: 6px; background: var(--surface); border-top: 1px solid var(--line); }
@keyframes slide-in { from { transform: translateX(24px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes slide-up { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.dialog-layer { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 16px; background: rgba(31, 36, 33, .32); animation: fade .12s ease-out; }
.dialog { width: min(420px, 100%); padding: 22px; background: var(--surface); border-radius: var(--radius-xl); box-shadow: var(--shadow-lg); animation: slide-up .16s ease-out; }
.dialog h2 { font-size: 16px; }
#dialog-body { margin-top: 8px; color: var(--fg-2); font-size: 14px; line-height: 1.55; }
#dialog-body .code { margin-top: 10px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; }
.menu-pop {
  position: fixed;
  z-index: 70;
  min-width: 190px;
  padding: 5px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  animation: fade .1s ease-out;
}
.menu-pop button { display: flex; align-items: center; gap: 9px; width: 100%; height: 34px; padding: 0 10px; border: 0; border-radius: var(--radius-sm); background: transparent; color: var(--fg); font: 400 13.5px/1 var(--font); text-align: left; cursor: pointer; }
.menu-pop button:hover { background: var(--hover); }
.menu-pop button .ti { font-size: 16px; color: var(--fg-3); }
.menu-pop button.danger, .menu-pop button.danger .ti { color: var(--bad); }
.menu-pop hr { border: 0; border-top: 1px solid var(--line); margin: 4px 0; }
.toasts { position: fixed; z-index: 80; right: 20px; bottom: 20px; display: grid; gap: 8px; }
.toast { display: flex; align-items: center; gap: 10px; min-width: 260px; max-width: 420px; padding: 11px 14px; border-radius: var(--radius-lg); background: var(--ink); color: var(--on-ink); font-size: 13.5px; box-shadow: var(--shadow-lg); animation: slide-up .18s ease-out; }
.toast .ti { font-size: 18px; color: #8fd3b0; }
.toast.bad .ti { color: #f3a08c; }

/* ---------- Phones and small tablets ---------- */
@media (max-width: 860px) {
  .app { display: block; }
  .sidebar {
    position: fixed;
    z-index: 40;
    left: 0;
    top: 0;
    bottom: 0;
    width: min(290px, 86vw);
    height: 100dvh;
    transform: translateX(-100%);
    transition: transform .2s cubic-bezier(.2, .8, .2, 1);
    box-shadow: none;
  }
  .app.menu-open .sidebar { transform: none; box-shadow: var(--shadow-lg); }
  .scrim { z-index: 30; }
  .topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    gap: 6px;
    height: 52px;
    padding: 0 10px;
    padding-top: env(safe-area-inset-top);
    background: rgba(251, 250, 247, .92);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--line);
  }
  .topbar-title { font-weight: 600; font-size: 15px; }
  .page { padding: 20px 16px 48px; }
  .page-head { flex-direction: column; align-items: stretch; }
  .page-actions { justify-content: flex-start; }
  .page-head h1, .greeting h1 { font-size: 21px; }
  .row2 { grid-template-columns: 1fr; }
  .rows > li { flex-wrap: wrap; }
  .rows > li .row-end { width: 100%; justify-content: flex-end; }
  .rows > li .row-end:empty { display: none; }
  .page-chat, .page-split { height: calc(100dvh - 52px); grid-template-columns: minmax(0, 1fr); }
  .chat-col { height: calc(100dvh - 52px); }
  .chat-head { display: none; }
  .chat-scroll { padding: 18px 14px 8px; }
  .composer-wrap { padding: 8px 12px calc(12px + env(safe-area-inset-bottom)); }
  .details { position: fixed; z-index: 45; top: 0; right: 0; width: min(360px, 92vw); box-shadow: var(--shadow-lg); }
  .page-split .split-list { border-right: 0; }
  .page-split.has-selection .split-list { display: none; }
  .page-split:not(.has-selection) > .chat-col { display: none; }
  .sheet { top: auto; left: 0; width: 100vw; max-height: 92dvh; border-left: 0; border-top: 1px solid var(--line); border-radius: 18px 18px 0 0; animation: slide-up .2s ease-out; }
  .sheet-actions { bottom: -28px; padding-bottom: env(safe-area-inset-bottom); }
  .toasts { left: 12px; right: 12px; bottom: 12px; }
  .toast { min-width: 0; max-width: none; }
  .stats { grid-template-columns: 1fr 1fr; }
  .stat-value { font-size: 22px; }
}

/* Conversations (tone) */
.switch { position: relative; display: inline-flex; width: 34px; height: 20px; flex: none; }
.switch input { position: absolute; opacity: 0; inset: 0; margin: 0; width: 100%; height: 100%; cursor: pointer; }
.switch span { position: absolute; inset: 0; border-radius: 999px; background: var(--line); transition: background .15s; }
.switch span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 14px; height: 14px; border-radius: 50%; background: var(--surface); box-shadow: var(--shadow-sm); transition: transform .15s; }
.switch input:checked + span { background: var(--accent); }
.switch input:checked + span::after { transform: translateX(14px); }
.switch input:disabled { cursor: not-allowed; }
.switch input:disabled + span { opacity: .6; }
.conv-tools { margin: 14px 0; }
.rows > li.row-click { cursor: pointer; }
.rows > li.row-click:hover { background: var(--hover); }
.conv-langs { display: flex; align-items: center; gap: 10px; margin-top: 8px; min-width: 0; }
.conv-langs .hint { margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.langbar { display: flex; height: 10px; border-radius: 999px; overflow: hidden; background: var(--surface-2); border: 1px solid var(--line); margin: 6px 0; }
.langbar span { display: block; height: 100%; }
.langbar-sm { width: 96px; height: 7px; margin: 0; flex: none; }
.langbar-empty { opacity: .5; }
.lang-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.lang-chip { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--fg-2); padding: 2px 8px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); }
.lang-chip i { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 6px 14px; margin: 12px 0; font-size: 13px; }
.facts dt { color: var(--fg-3); }
.facts dd { margin: 0; color: var(--fg); }
.metric { display: grid; grid-template-columns: 120px 1fr; gap: 10px; align-items: center; padding: 6px 0; border-top: 1px solid var(--line); }
.metric-name { font-size: 13px; color: var(--fg-2); }
.metric-reset { font-size: 11.5px; padding: 0 0 0 4px; }
.metric-bars { display: grid; gap: 4px; min-width: 0; }
.meter { display: grid; grid-template-columns: 38px 1fr 28px; gap: 8px; align-items: center; }
.meter-who { font-size: 11px; color: var(--fg-3); }
.meter-v { font-size: 11.5px; color: var(--fg-2); text-align: right; font-variant-numeric: tabular-nums; }
.meter-track { display: block; height: 8px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); overflow: hidden; }
.meter-track i { display: block; height: 100%; border-radius: 999px; }
.meter input[type=range] { -webkit-appearance: none; appearance: none; width: 100%; height: 8px; min-height: 0; padding: 0; border-radius: 999px; border: 1px solid var(--line);
  background: linear-gradient(to right, var(--c, var(--accent)) var(--v, 50%), var(--surface-2) var(--v, 50%)); cursor: pointer; }
.meter input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 16px; height: 16px; border-radius: 50%; background: var(--surface); border: 2px solid var(--accent); box-shadow: var(--shadow-sm); }
.meter input[type=range]::-moz-range-thumb { width: 14px; height: 14px; border-radius: 50%; background: var(--surface); border: 2px solid var(--accent); }
@media (max-width: 860px) { .metric { grid-template-columns: 1fr; gap: 4px; } }
.agent-desc { margin: 4px 0 0; font-size: 12.5px; color: var(--fg-2); max-width: 62ch; line-height: 1.45; }
.split-group { padding: 12px 14px 4px; font-size: 11.5px; font-weight: 600; color: var(--fg-3); text-transform: uppercase; letter-spacing: .04em; }
.record { padding: 18px 22px; max-width: 720px; }
.record p { margin: 6px 0 12px; }
.updates { list-style: none; margin: 6px 0 14px; padding: 0; display: grid; gap: 10px; }
.updates li { padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.activity { list-style: none; margin: 4px 0; }
.activity-head { width: 100%; display: flex; align-items: center; gap: 8px; padding: 8px 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface-2); color: var(--fg-2); font: 500 12.5px/1.3 var(--font); cursor: pointer; text-align: left; }
.activity-head:hover { background: var(--hover); }
.activity-title { color: var(--fg); white-space: nowrap; }
.activity-last { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--fg-3); }
.activity-steps { list-style: none; margin: 4px 0 0; padding: 0 0 0 14px; border-left: 2px solid var(--line); display: grid; gap: 2px; }
.activity-steps details summary { display: flex; gap: 8px; align-items: baseline; padding: 4px 6px; cursor: pointer; font-size: 12.5px; color: var(--fg-2); list-style: none; }
.activity-steps details summary::-webkit-details-marker { display: none; }
.activity-steps details[open] summary { color: var(--fg); }
.step-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.step-at { color: var(--fg-3); font-size: 11.5px; }
.activity-steps pre { margin: 2px 6px 8px; padding: 8px 10px; max-height: 260px; overflow: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 6px; font-size: 11.5px; white-space: pre-wrap; word-break: break-word; }
.head-main { min-width: 0; }
.title-row { display: flex; align-items: center; gap: 4px; min-width: 0; }
.title-row h1 { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.icon-btn-sm { width: 26px; height: 26px; font-size: 14px; color: var(--fg-3); }
.rename-form { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.rename-form .input { min-width: 0; width: min(320px, 60vw); padding: 6px 10px; font-size: 14px; }
@media (max-width: 860px) {
  .page-split .chat-head { display: flex; padding: 10px 14px; }
  .page-split .chat-head .agent-desc { display: none; }
}
/* Workspace tabs and the setup guides shown in them. */
.ws-tabs { margin-bottom: 20px; }
.seg a { display: inline-flex; align-items: center; height: 28px; padding: 0 12px; border-radius: 7px; color: var(--fg-3); font: 500 12.5px/1 var(--font); text-decoration: none; }
.seg a.on { background: var(--surface); color: var(--fg); box-shadow: var(--shadow-sm); }
.seg a:hover:not(.on) { color: var(--fg); }
.doc { max-width: 720px; display: grid; gap: 32px; color: var(--fg); font-size: 14.5px; line-height: 1.6; }
.doc header { display: grid; gap: 8px; }
.doc h1 { font-size: 24px; letter-spacing: -0.01em; margin: 0; }
.doc h2 { font-size: 17px; margin: 0; display: flex; gap: 10px; align-items: baseline; text-wrap: balance; }
.doc h2 .n { font: 600 12px/1 var(--mono); color: var(--accent); background: var(--accent-soft); border-radius: 5px; padding: 4px 6px; flex: none; }
.doc h3 { font-size: 14.5px; margin: 4px 0 0; }
.doc p { margin: 0; }
.doc section { display: grid; gap: 12px; min-width: 0; }
.doc .lede { color: var(--fg-2); font-size: 15px; max-width: 64ch; }
.doc ol, .doc ul { margin: 0; padding-left: 22px; display: grid; gap: 8px; }
.doc a { color: var(--accent); }
.doc .facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; }
.doc .fact { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 11px 13px; display: grid; gap: 2px; }
.doc .fact span { color: var(--fg-3); font-size: 13px; }
.doc .cmd { position: relative; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius); min-width: 0; }
.doc .cmd pre { margin: 0; padding: 11px 80px 11px 13px; overflow-x: auto; font: 12.5px/1.55 var(--mono); white-space: pre; }
.doc .cmd.tall pre { max-height: 420px; overflow: auto; }
.doc .cmd button { position: absolute; top: 7px; right: 7px; font: 600 12px/1 var(--font); color: var(--fg); background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: 7px 10px; cursor: pointer; }
.doc code { font: 12.5px var(--mono); background: var(--surface-2); border-radius: 4px; padding: 1px 5px; }
.doc .ui { font-weight: 600; }
.doc .note { border-left: 3px solid var(--accent); background: var(--surface); padding: 10px 14px; border-radius: 0 var(--radius) var(--radius) 0; }
.doc .note.warn { border-color: var(--warn); background: var(--warn-soft); }
.doc .check { color: var(--fg-3); }
.doc .badge { font: 500 11px/1 var(--mono); color: var(--fg-3); border: 1px solid var(--line); border-radius: 999px; padding: 4px 8px; white-space: nowrap; }
.doc dl { margin: 0; display: grid; gap: 12px; }
.doc dt { font-weight: 600; }
.doc dd { margin: 2px 0 0; color: var(--fg-3); }
.doc hr { border: 0; border-top: 1px solid var(--line); margin: 0; }
.doc .table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.doc .secrets { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.doc .secrets th, .doc .secrets td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.doc .secrets th { font-weight: 600; color: var(--fg-3); font-size: 12px; text-transform: uppercase; letter-spacing: 0.05em; }
.doc .secrets code { word-break: break-all; }
/* Help chat (Workspace → Help). */
.help-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 20px; align-items: start; }
.help-chat { display: grid; gap: 10px; min-width: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 14px; }
.help-chat .chat-list { max-height: calc(100dvh - 300px); min-height: 220px; overflow-y: auto; margin: 0; padding: 0; }
.help-status { margin: 0; font-size: 13px; color: var(--fg-3); }
.help-note { list-style: none; font-size: 12.5px; color: var(--fg-3); padding: 4px 0 4px 34px; }
.help-todos { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 14px; display: grid; gap: 8px; }
.help-todos ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: 13.5px; }
.help-todos li { display: flex; gap: 8px; align-items: flex-start; }
.help-todos li .ti { color: var(--fg-4); margin-top: 3px; }
.help-todos li.done { color: var(--fg-3); text-decoration: line-through; }
.help-todos li.done .ti { color: var(--ok); }
@media (max-width: 860px) { .help-wrap { grid-template-columns: minmax(0, 1fr); } .help-todos { order: -1; } }
/* Workspace icons: the image fills the mark on a light tile. */
.brand-mark.has-img { background: var(--surface); border: 1px solid var(--line); overflow: hidden; padding: 0; }
.brand-mark.has-img img { width: 100%; height: 100%; object-fit: contain; display: block; }
.icon-pick { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.icon-pick .brand-mark { width: 40px; height: 40px; border-radius: 10px; font-size: 16px; }
/* Discover */
.disc-search { display: flex; align-items: center; gap: 8px; max-width: 520px; margin-bottom: 18px; padding: 0 12px; height: 40px; border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--surface); color: var(--fg-3); }
.disc-search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; box-shadow: none; padding: 0; height: 100%; font: 14px var(--font); color: var(--fg); }
.disc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.disc-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 14px 16px; display: grid; gap: 6px; align-content: start; }
.disc-card h3 { margin: 0; font-size: 14.5px; }
.disc-desc { margin: 0; color: var(--fg-2); font-size: 13px; line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.disc-meta { color: var(--fg-3); font-size: 12px; }
.disc-actions { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-top: 4px; }
.disc-empty { color: var(--fg-3); font-size: 13.5px; padding: 18px; border: 1px dashed var(--line-strong); border-radius: var(--radius-lg); }

/* Daily digest on Home: a strip of days, then that day's cards. */
.digest .day-strip { position: relative; display: flex; gap: 6px; overflow-x: auto; padding: 2px 0 8px; scrollbar-width: thin; }
.digest .day { flex: 0 0 auto; display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 48px; padding: 6px 4px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface, #fff); color: var(--fg-2); cursor: pointer; font: inherit; }
.digest .day:hover { border-color: var(--line-strong); }
.digest .day.on { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.digest .day:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--accent-ring); }
.digest .day-wd { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; }
.digest .day-n { font-size: 16px; font-weight: 600; font-variant-numeric: tabular-nums; }
.digest .day-dot { width: 6px; height: 6px; border-radius: 50%; background: transparent; }
.digest .day-dot.l1 { background: var(--line-strong); }
.digest .day-dot.l2 { background: var(--accent); opacity: .55; }
.digest .day-dot.l3 { background: var(--accent); }
.digest-line { margin: 4px 0 12px; color: var(--fg-2); }
.digest-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.digest-card { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; background: var(--surface, #fff); min-width: 0; }
.digest-card h3 { margin: 0 0 8px; font-size: 13px; font-weight: 600; color: var(--fg-2); text-transform: uppercase; letter-spacing: .04em; }
.digest-card ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.digest-card li { overflow-wrap: anywhere; line-height: 1.4; }
.digest-card .muted { color: var(--fg-3, var(--fg-2)); font-size: 13px; }

/* Time saved, above the day strip. */
.time-saved { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 14px; margin: 0 0 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--accent-soft); }
.time-saved strong { font-weight: 600; }
.time-saved .muted { color: var(--fg-2); font-size: 13px; margin-top: 2px; }
.table-wrap { overflow-x: auto; margin-bottom: 8px; }
.time-saved-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.time-saved-table th, .time-saved-table td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.time-saved-table th { color: var(--fg-2); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
.muted.small { font-size: 12px; }
@media (max-width: 560px) { .time-saved { flex-direction: column; align-items: flex-start; } }

/* Small select inside a tile footer (Zoho region). */
.input-sm { font: inherit; font-size: 12.5px; padding: 4px 8px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--surface); color: var(--fg); max-width: 170px; }
.tile-foot .input-sm { margin-left: auto; margin-right: 6px; }

/* Single sign-on: values to copy into the identity provider. */
.kv-list { margin: 0 0 12px; font-size: 13px; }
.kv-list dt { color: var(--fg-3); margin-top: 6px; }
.kv-list dd { margin: 2px 0 0; overflow-wrap: anywhere; }
