/* AI4ERP Assistant in the Epicor Kinetic look. Kinetic's frame (icon rail, header, tabs, fields) with Kinetic's own design
   tokens; the conversation reads like a document, and answer tables become raised "ledger sheets" (the signature). */
:root {
  /* Kinetic design tokens (Kinetic web app :root) */
  --primary: hsl(192, 96%, 20%);
  --primary-2485: hsl(192, 24%, 85%);
  --primary-2491: hsl(192, 24%, 91%);
  --primary-3468: hsl(192, 34%, 68%);
  --primary-3495: hsl(192, 34%, 95%);
  --accent: hsl(19, 97%, 81%);
  --interactive: hsl(201, 85%, 34%);
  --interactive-24: hsl(201, 85%, 24%);
  --interactive-44: hsl(201, 85%, 44%);
  --interactive-82: hsl(201, 85%, 82%);
  --interactive-x96: hsl(201, 100%, 96%);
  --base: hsl(206, 26%, 95%);
  --neutral: hsl(0, 0%, 100%);
  --neutral-20: hsl(0, 0%, 20%);
  --neutral-27: hsl(0, 0%, 27%);
  --neutral-38: hsl(0, 0%, 38%);
  --neutral-52: hsl(0, 0%, 52%);
  --neutral-80: hsl(0, 0%, 80%);
  --neutral-95: hsl(0, 0%, 95%);
  --focus: hsl(323, 32%, 57%);
  --error: hsl(7, 100%, 71%);
  --error-50: hsl(7, 100%, 50%);
  --error-91: hsl(7, 100%, 91%);
  --success: hsl(172, 43%, 52%);
  --success-9532: hsl(172, 95%, 32%);
  --success-x96: hsl(172, 100%, 96%);
  --warning-41: hsl(44, 100%, 41%);
  --warning-91: hsl(44, 100%, 91%);

  /* this product's own */
  --ink: #1b2a30;              /* text: teal-tinted near black */
  --ink-soft: #52656c;         /* secondary text */
  --mist: #eef3f5;             /* page canvas */
  --paper: #ffffff;
  --deep: #013f50;             /* the teal of user bubbles and code sheets */
  --hair: rgba(2, 80, 100, .10);
  --hair-strong: rgba(2, 80, 100, .18);
  --lift-1: 0 1px 2px rgba(16, 42, 52, .06), 0 1px 1px rgba(16, 42, 52, .04);
  --lift-2: 0 10px 28px -12px rgba(16, 42, 52, .22), 0 2px 6px rgba(16, 42, 52, .06);
  --lift-3: 0 28px 60px -20px rgba(2, 60, 76, .38), 0 4px 12px rgba(16, 42, 52, .08);
  --r-s: 8px;
  --r-m: 12px;
  --r-l: 16px;
  --r-xl: 22px;

  --font: "Source Sans 3", "Source Sans Pro", SourceSansPro, Roboto, Arial, sans-serif;
  --mono: "Roboto Mono", SFMono-Regular, Menlo, Consolas, monospace;
  --rail: 64px;
  --side: 264px;
  --ease: cubic-bezier(.2, .7, .2, 1);
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { background: var(--mist); color: var(--ink); font: 16px/1.5 var(--font); -webkit-font-smoothing: antialiased; }
[hidden] { display: none !important; }
button, input, select, textarea { font: inherit; color: inherit; }
button { -webkit-tap-highlight-color: transparent; }
[data-icon] { display: inline-grid; place-items: center; flex: none; }
svg { width: 22px; height: 22px; fill: currentColor; display: block; }
a { color: var(--interactive); }
:focus-visible { outline: 2px solid var(--interactive-44); outline-offset: 2px; }
.muted { color: var(--ink-soft); }

/* ============================================================ buttons */
.kbtn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 0 18px; border-radius: 10px;
  border: 1px solid var(--hair-strong); background: var(--paper); color: var(--interactive); font-size: 15.5px; font-weight: 600; cursor: pointer;
  white-space: nowrap; transition: background .15s var(--ease), box-shadow .15s var(--ease), transform .15s var(--ease); }
.kbtn svg { width: 18px; height: 18px; }
.kbtn:hover { background: var(--interactive-x96); }
.kbtn:active { transform: translateY(1px); }
.kbtn-primary { border-color: transparent; background: linear-gradient(180deg, hsl(201, 80%, 38%), var(--interactive)); color: var(--paper);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .18) inset, 0 6px 14px -6px hsla(201, 85%, 30%, .55); }
.kbtn-primary:hover { background: linear-gradient(180deg, var(--interactive), var(--interactive-24)); }
.kbtn-danger { border-color: rgba(230, 40, 20, .35); color: var(--error-50); }
.kbtn-danger:hover { background: var(--error-91); }
.kbtn-danger-solid { border-color: transparent; background: linear-gradient(180deg, hsl(7, 80%, 55%), hsl(7, 78%, 48%)); color: var(--paper);
  box-shadow: 0 6px 14px -6px hsla(7, 80%, 40%, .55); }
.kbtn-danger-solid:hover { background: hsl(7, 78%, 44%); }
.kbtn:disabled { opacity: .5; cursor: default; box-shadow: none; transform: none; }
.kbtn-wide { width: 100%; }
.icon-btn { display: inline-grid; place-items: center; width: 38px; height: 38px; border: 0; border-radius: 10px; background: transparent; color: var(--ink-soft);
  cursor: pointer; transition: background .15s var(--ease), color .15s var(--ease); }
.icon-btn:hover { background: var(--primary-3495); color: var(--interactive); }
.ghost-btn { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 12px; border: 0; border-radius: 10px; background: transparent;
  color: var(--ink-soft); font-size: 15px; font-weight: 600; cursor: pointer; transition: background .15s var(--ease), color .15s var(--ease); }
.ghost-btn svg { width: 18px; height: 18px; }
.ghost-btn:hover { background: var(--error-91); color: var(--error-50); }

/* ============================================================ Kinetic field: label inside, value below, blue underline */
.kfield { position: relative; display: flex; flex-direction: column; min-height: 58px; padding: 7px 12px 6px; margin: 0 0 14px; background: var(--paper);
  border: 1px solid var(--hair); border-bottom: 1.5px solid hsl(201, 30%, 60%); border-radius: var(--r-s) var(--r-s) 4px 4px;
  transition: border-color .15s var(--ease), box-shadow .15s var(--ease); }
.kfield:hover { border-bottom-color: var(--interactive); }
.kfield:focus-within { border-color: var(--focus); box-shadow: 0 0 0 3px hsla(323, 32%, 57%, .16); }
.kfield-label { font-size: 14.5px; line-height: 1.25; color: var(--ink-soft); }
.kfield-label em { font-style: normal; }
.kfield-label small { margin-left: 6px; font-size: 13px; color: var(--neutral-52); }
.kfield input, .kfield select { width: 100%; padding: 2px 0 0; border: 0; outline: none; background: transparent; font-size: 17px; line-height: 1.35; color: var(--ink); }
.kfield input::placeholder { color: hsl(200, 8%, 66%); }
.kfield-select select { appearance: none; -webkit-appearance: none; padding-right: 28px; cursor: pointer; }
.kfield-select .caret { position: absolute; right: 10px; bottom: 8px; color: var(--interactive); pointer-events: none; }
.kfield:has(input:disabled), .kfield:has(select:disabled) { background: var(--base); border-color: transparent; }
.kfield:has(select:disabled) .caret { display: none; }
.kfield input:disabled, .kfield select:disabled { color: var(--neutral-27); -webkit-text-fill-color: var(--neutral-27); opacity: 1; }
.readonly { display: flex; flex-direction: column; gap: 2px; min-height: 58px; padding: 8px 12px; margin: 0 0 14px; background: var(--base); border-radius: var(--r-s);
  font-size: 15.5px; }

.kmsg { margin: 0 0 16px; padding: 11px 14px; border-radius: var(--r-s); font-size: 15px; border-left: 4px solid; }
.kmsg-error { background: var(--error-91); border-color: var(--error-50); }
.kmsg-warning { background: var(--warning-91); border-color: var(--warning-41); }

/* ============================================================ sign-in */
.login { min-height: 100%; display: grid; place-items: center; padding: 32px 16px; background: radial-gradient(1200px 600px at 10% 0%, var(--primary-3495), var(--mist)); }
.login-panel { display: grid; grid-template-columns: 1.05fr 1fr; width: 100%; max-width: 920px; min-height: 520px; background: var(--paper); border-radius: var(--r-xl);
  box-shadow: var(--lift-3); overflow: hidden; }
.login-hero { display: flex; flex-direction: column; gap: 14px; padding: 44px 40px; color: var(--paper); overflow: hidden; position: relative;
  background: linear-gradient(155deg, var(--primary) 0%, hsl(196, 90%, 16%) 60%, hsl(199, 89%, 12%) 100%); }
.login-hero::after { content: ""; position: absolute; right: -80px; bottom: -80px; width: 280px; height: 280px; border-radius: 50%;
  background: radial-gradient(closest-side, hsla(19, 97%, 81%, .22), transparent); }
.brand { display: flex; align-items: center; gap: 12px; font-size: 20px; font-weight: 700; letter-spacing: .5px; }
.brand-mark { width: 42px; height: 42px; border-radius: 12px; background: hsla(0, 0%, 100%, .12); color: var(--accent); }
.login-hero h1 { margin: 36px 0 0; font-size: 34px; font-weight: 300; line-height: 1.15; }
.login-hero p { margin: 0; font-size: 17px; opacity: .85; }
.hero-points { list-style: none; margin: auto 0 0; padding: 0; display: flex; flex-direction: column; gap: 10px; font-size: 15px; opacity: .9; }
.hero-points li { display: flex; align-items: center; gap: 10px; }
.hero-points svg { width: 18px; height: 18px; color: var(--success); }
.login-form { display: flex; flex-direction: column; justify-content: center; padding: 44px 40px; }
.login-form h2 { margin: 0 0 4px; font-size: 28px; font-weight: 400; }
.login-form .muted { margin: 0 0 24px; }
.login-note { margin: 18px 0 0; font-size: 13px; color: var(--neutral-52); text-align: center; }

/* ============================================================ frame */
.shell { height: 100%; display: grid; grid-template-columns: var(--rail) minmax(0, 1fr); }
.rail { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 14px 0; background: linear-gradient(180deg, var(--primary), hsl(194, 92%, 16%));
  color: var(--paper); z-index: 20; }
.rail-btn { display: grid; place-items: center; width: 46px; height: 46px; border: 0; border-radius: 12px; background: transparent; color: var(--paper);
  cursor: pointer; opacity: .82; transition: background .15s var(--ease), opacity .15s var(--ease); }
.rail-btn svg { width: 24px; height: 24px; }
.rail-btn:hover { background: hsla(0, 0%, 100%, .12); opacity: 1; }
.rail-btn.active { background: hsla(0, 0%, 100%, .2); opacity: 1; }
.rail-spacer { flex: 1; }

.workspace { display: grid; grid-template-rows: auto auto auto minmax(0, 1fr); grid-template-columns: minmax(0, 1fr); min-width: 0; min-height: 0; height: 100%; }
.topline { display: flex; align-items: stretch; justify-content: space-between; gap: 12px; min-height: 30px; }
.crumbs { display: flex; align-items: center; gap: 4px; padding: 4px 16px 0 24px; font-size: 15px; color: var(--ink-soft); min-width: 0; }
.crumbs > span:first-child { white-space: nowrap; }
.crumb-sep svg { width: 18px; height: 18px; color: var(--neutral-52); }
#crumbPage { color: var(--neutral-52); white-space: nowrap; }
.context { display: flex; align-items: center; gap: 18px; padding: 3px 16px; background: var(--primary); color: var(--paper); font-size: 14.5px;
  border-bottom-left-radius: 10px; white-space: nowrap; overflow: hidden; max-width: 60%; }
.context span { overflow: hidden; text-overflow: ellipsis; }
.context:empty { display: none; }

.page-head { display: flex; align-items: center; flex-wrap: wrap; gap: 12px 22px; padding: 12px 24px 6px 24px; }
.title-block { display: flex; align-items: center; gap: 16px; min-width: 0; }
.title-block h1 { margin: 0; font-size: 34px; font-weight: 300; line-height: 1.1; letter-spacing: -.3px; color: var(--ink); overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap; max-width: 46vw; }
.pill { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; border-radius: 999px; font-size: 15px; font-weight: 700;
  color: var(--ink); white-space: nowrap; }
.pill.ok { background: var(--success); }
.pill.bad { background: var(--error); }
.pill.info { background: var(--interactive-82); }
.pill.neutral { background: var(--base); color: var(--neutral-27); }
.pill:empty { display: none; }
.head-fields { display: flex; align-items: stretch; min-width: 0; }
.head-field { position: relative; display: flex; flex-direction: column; justify-content: center; padding: 0 18px; border-left: 1px solid var(--hair-strong); min-width: 0; }
.head-field:first-child { border-left: 0; padding-left: 0; }
.head-label { font-size: 14.5px; color: var(--ink-soft); line-height: 1.25; }
.head-value { font-size: 16px; color: var(--ink); white-space: nowrap; }
.head-link { display: inline-flex; align-items: center; gap: 2px; padding: 0; border: 0; background: none; color: var(--interactive); font-size: 16px; cursor: pointer; max-width: 260px; }
.head-link > span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.head-link .caret svg { width: 24px; height: 24px; }
.toolbar { display: flex; align-items: center; gap: 2px; margin-left: auto; padding: 3px; border-radius: 12px; background: var(--paper); box-shadow: var(--lift-1); }
.tool { display: grid; place-items: center; width: 38px; height: 36px; border: 0; border-radius: 9px; background: transparent; color: var(--interactive); cursor: pointer;
  transition: background .15s var(--ease); }
.tool svg { width: 22px; height: 22px; }
.tool:hover { background: var(--interactive-x96); }

.tabs { display: flex; align-items: flex-end; gap: 4px; padding: 6px 24px 0; overflow-x: auto; scrollbar-width: none; }
.tab { position: relative; padding: 9px 18px; border: 1px solid transparent; border-radius: 10px; background: transparent; color: var(--interactive); font-size: 17px;
  cursor: pointer; white-space: nowrap; transition: background .15s var(--ease); }
.tab:hover { background: rgba(255, 255, 255, .6); }
.tab[aria-selected="true"] { background: var(--paper); border-color: var(--hair); color: var(--ink); font-weight: 600; box-shadow: var(--lift-1); }

.content { display: grid; grid-template-columns: var(--side) minmax(0, 1fr); gap: 14px; padding: 12px 24px 18px 14px; min-height: 0; }
.side { display: flex; flex-direction: column; gap: 14px; padding: 16px 14px; background: var(--paper); border-radius: var(--r-l); box-shadow: var(--lift-1);
  min-height: 0; overflow: hidden; }
.search { display: flex; align-items: center; gap: 6px; height: 40px; padding: 0 10px 0 12px; border: 1px solid var(--hair-strong); border-radius: 10px; background: var(--paper); }
.search:focus-within { border-color: var(--interactive-44); box-shadow: 0 0 0 3px hsla(201, 85%, 44%, .14); }
.search input { flex: 1; min-width: 0; border: 0; outline: none; background: transparent; font-size: 15.5px; }
.search svg { color: var(--interactive); width: 20px; height: 20px; }
.tree { flex: 1; overflow-y: auto; margin: 0 -6px; padding: 0 6px; }
.tree-head { position: relative; display: flex; align-items: center; margin: 2px 0 6px; padding: 2px 0 7px 16px; border-bottom: 1px solid var(--hair-strong);
  font-size: 16.5px; font-weight: 600; color: var(--interactive); }
.tree-head::before { content: ""; position: absolute; left: 0; top: 9px; border: 5px solid transparent; border-left: 7px solid var(--interactive); }
.tree-section { margin: 18px 0 6px; padding-left: 2px; font-size: 13px; font-weight: 700; letter-spacing: .6px; text-transform: uppercase; color: var(--neutral-52); }
.tree-row { position: relative; display: flex; align-items: center; border-radius: 10px; transition: background .15s var(--ease); }
.tree-row:hover { background: var(--primary-3495); }
.tree-item { display: flex; align-items: center; gap: 10px; width: 100%; min-width: 0; padding: 7px 8px; border: 0; border-radius: 10px; background: none; text-align: left;
  font-size: 15.5px; color: var(--ink); cursor: pointer; }
.tree-item svg { width: 19px; height: 19px; color: var(--ink-soft); }
.tree-item > span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tree-row > .tree-item { padding-right: 38px; }
.tree-item:hover { background: var(--primary-3495); }
.tree-item.active, .tree-row.active { background: var(--primary-2491); }
.tree-item.active { color: var(--deep); font-weight: 600; }
.tree-item.active svg { color: var(--interactive); }
.tree-item.add, .tree-item.add svg { color: var(--interactive); }
.tree-del { position: absolute; right: 4px; width: 30px; height: 30px; border-radius: 8px; opacity: 0; }
.tree-del svg { width: 17px; height: 17px; }
.tree-row:hover .tree-del, .tree-row:focus-within .tree-del { opacity: 1; }
.tree-del:hover { background: var(--error-91); color: var(--error-50); }
@media (hover: none) { .tree-del { opacity: .7; } }
.tree-empty { padding: 4px 8px; font-size: 15px; color: var(--neutral-52); }
.scrim { display: none; }

/* ============================================================ cards (environments, help) */
.pane { min-width: 0; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr); }
.card { display: grid; grid-template-rows: auto minmax(0, 1fr); grid-template-columns: minmax(0, 1fr); min-height: 0; background: var(--paper); border-radius: var(--r-l);
  box-shadow: var(--lift-1); overflow: hidden; }
.card-band { display: flex; align-items: center; gap: 12px; min-height: 64px; padding: 10px 22px; background: linear-gradient(180deg, var(--primary-3495), var(--paper));
  border-bottom: 1px solid var(--hair); }
.card-band h2 { flex: 1; margin: 0; font-size: 20px; font-weight: 600; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.band-icon { color: var(--interactive); }
.card-body { overflow-y: auto; padding: 20px 22px 8px; background: linear-gradient(180deg, var(--paper), #f7fafb); }
.groups { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px 28px; }
.group { min-width: 0; margin: 0; padding: 0; border: 0; }
.group legend, .group h3 { padding: 0; margin: 0 0 12px; font-size: 18px; font-weight: 600; color: var(--ink); }
.group p { margin: 0 0 12px; font-size: 16px; color: var(--ink-soft); }
.group-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.status-list { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.help-note { margin-top: 6px; }
.connector { margin-top: 14px; }
.connector textarea { width: 100%; margin-top: 4px; border: 0; outline: none; resize: none; background: transparent; font: 12.5px/1.45 var(--mono); color: var(--ink);
  word-break: break-all; }
.connector-steps { margin: 12px 0 0; padding-left: 20px; font-size: 15px; color: var(--ink-soft); }
.connector-steps li { margin-bottom: 6px; }

/* ============================================================ the conversation */
.chat { position: relative; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; grid-template-columns: minmax(0, 1fr); min-height: 0; border-radius: var(--r-l);
  background: radial-gradient(900px 420px at 100% 0%, hsla(19, 97%, 81%, .10), transparent 60%), linear-gradient(180deg, var(--paper), #f5f9fa);
  box-shadow: var(--lift-1); border: 1px solid var(--hair); overflow: hidden; }
.chat-head { display: flex; align-items: center; gap: 14px; padding: 12px 18px 12px 24px; border-bottom: 1px solid var(--hair); background: rgba(255, 255, 255, .72);
  backdrop-filter: saturate(1.4) blur(6px); z-index: 2; }
.chat-head-title { flex: 1; min-width: 0; display: flex; align-items: baseline; gap: 12px; }
.chat-head-title h2 { margin: 0; min-width: 0; font-size: 18px; font-weight: 600; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-head-meta { font-size: 14px; color: var(--ink-soft); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-head-actions { display: flex; align-items: center; gap: 6px; }

.messages { overflow-y: auto; padding: 26px 24px 18px; display: flex; flex-direction: column; gap: 22px; min-width: 0; }
.msg { display: flex; gap: 14px; width: 100%; max-width: 860px; margin: 0 auto; animation: rise .28s var(--ease) both; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* your question: a compact deep-teal bubble */
.msg-user { justify-content: flex-end; }
.msg-user .msg-body { display: flex; flex-direction: column; align-items: flex-end; max-width: min(78%, 640px); }
.bubble { padding: 11px 16px; border-radius: 20px 20px 6px 20px; background: linear-gradient(180deg, hsl(201, 80%, 38%), var(--interactive)); color: var(--paper);
  font-size: 16.5px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; box-shadow: 0 6px 14px -6px hsla(201, 85%, 30%, .55); }
.msg-user .msg-meta { margin: 6px 6px 0 0; }
.bubble .msg-files { margin-top: 8px; }
.bubble .file-chip { background: hsla(0, 0%, 100%, .14); border-color: hsla(0, 0%, 100%, .22); color: var(--paper); }

/* the answer: a document beside the assistant mark */
.msg-bot .msg-body { flex: 1; min-width: 0; }
.msg-meta { display: flex; align-items: center; gap: 10px; font-size: 13.5px; color: var(--ink-soft); }
.msg-meta b { font-weight: 600; color: var(--ink); }
.msg-bot .msg-meta { margin: 5px 0 6px; }
.msg-actions { display: flex; align-items: center; gap: 4px; margin-top: 8px; opacity: 0; transition: opacity .15s var(--ease); }
.msg:hover .msg-actions, .msg:focus-within .msg-actions { opacity: 1; }
@media (hover: none) { .msg-actions { opacity: 1; } }
.msg-actions .ghost-btn { height: 30px; padding: 0 10px; font-size: 13.5px; }
.msg-actions .ghost-btn:hover { background: var(--primary-3495); color: var(--interactive); }
.msg-error .note { padding: 12px 16px; border-radius: var(--r-m); background: #fff4f2; border: 1px solid rgba(230, 40, 20, .18); color: var(--ink); font-size: 15.5px; }

.md { font-size: 16.5px; line-height: 1.62; color: var(--ink); overflow-wrap: anywhere; }
.md > :first-child { margin-top: 0; }
.md > :last-child { margin-bottom: 0; }
.md p, .md ul, .md ol { margin: 0 0 12px; }
.md ul, .md ol { padding-left: 22px; }
.md li { margin: 3px 0; }
.md li::marker { color: var(--interactive); }
.md strong { font-weight: 700; color: var(--deep); }
.md h1, .md h2, .md h3 { margin: 18px 0 8px; font-size: 18px; font-weight: 700; color: var(--ink); }
.md code { padding: 1px 6px; border-radius: 6px; background: rgba(2, 80, 100, .07); color: var(--deep); font: 14.5px var(--mono); }
.md pre { margin: 0 0 12px; padding: 14px 16px; overflow-x: auto; border-radius: var(--r-m); background: #0e2a33; box-shadow: var(--lift-2); }
.md pre code { padding: 0; background: none; color: #d6e8ee; font-size: 13.5px; line-height: 1.55; }

/* the signature: answer tables as raised ledger sheets */
.sheet { margin: 6px 0 16px; border-radius: var(--r-m); background: var(--paper); border: 1px solid var(--hair); box-shadow: var(--lift-2); overflow: hidden; }
.sheet-cap { display: flex; align-items: center; gap: 10px; padding: 7px 8px 7px 14px; border-bottom: 1px solid var(--hair); background: #f8fbfc; }
.sheet-cap .count { font: 500 12px/1 var(--mono); letter-spacing: .6px; text-transform: uppercase; color: var(--interactive); }
.sheet-cap .ghost-btn { margin-left: auto; height: 28px; padding: 0 10px; font-size: 13.5px; }
.sheet-cap .ghost-btn:hover { background: var(--primary-3495); color: var(--interactive); }
.grid-wrap { overflow-x: auto; }
.md table { border-collapse: collapse; width: 100%; font-size: 15px; overflow-wrap: normal; }
.md th { background: var(--paper); color: var(--ink-soft); font-size: 13px; font-weight: 700; letter-spacing: .4px; text-transform: uppercase; text-align: left;
  white-space: nowrap; border-bottom: 2px solid var(--primary); }
.md th, .md td { padding: 10px 14px; }
.md td { min-width: 90px; border-bottom: 1px solid var(--primary-2491); }
.md tbody tr:last-child td { border-bottom: 0; }
.md tbody tr:nth-child(even) td { background: #fafcfd; }
.md tbody tr:hover td { background: var(--interactive-x96); }
.md .num { text-align: right; font-family: var(--mono); font-size: 14px; font-variant-numeric: tabular-nums; }
.md th.num { font-family: var(--font); font-size: 13px; }

.typing { display: inline-flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: 999px; background: var(--paper); box-shadow: var(--lift-1);
  font-size: 14.5px; color: var(--ink-soft); }
.dots { display: inline-flex; gap: 5px; }
.dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--interactive-44); animation: blink 1.2s infinite var(--ease); }
.dots i:nth-child(2) { animation-delay: .18s; }
.dots i:nth-child(3) { animation-delay: .36s; }
@keyframes blink { 0%, 80%, 100% { opacity: .25; transform: scale(.75); } 40% { opacity: 1; transform: scale(1); } }
.link-btn { padding: 0; border: 0; background: none; color: var(--interactive); font-size: 14.5px; font-weight: 600; cursor: pointer; }

.notice { max-width: 860px; margin: 0 auto; }

/* empty state */
.welcome { width: 100%; max-width: 820px; margin: 5vh auto 0; }
.welcome h3 { margin: 0; font-size: 40px; font-weight: 300; line-height: 1.1; letter-spacing: -.6px; color: var(--ink); }
.welcome h3 b { font-weight: 600; color: var(--deep); }
.welcome p { margin: 10px 0 28px; font-size: 17.5px; color: var(--ink-soft); }
.suggestions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.suggestion { display: flex; align-items: flex-start; gap: 14px; padding: 16px 18px; border: 1px solid var(--hair); border-radius: var(--r-m); background: var(--paper);
  text-align: left; cursor: pointer; box-shadow: var(--lift-1); transition: transform .18s var(--ease), box-shadow .18s var(--ease), border-color .18s var(--ease); }
.suggestion:hover { transform: translateY(-2px); box-shadow: var(--lift-2); border-color: var(--hair-strong); }
.suggestion .s-icon { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 11px; background: var(--primary-3495); color: var(--interactive); }
.suggestion .s-icon svg { width: 20px; height: 20px; }
.suggestion .s-text { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.suggestion .s-tag { font-size: 12.5px; font-weight: 700; letter-spacing: .7px; text-transform: uppercase; color: var(--interactive); }
.suggestion .s-q { font-size: 16.5px; line-height: 1.35; color: var(--ink); }

/* composer: one floating tray */
.composer { position: relative; padding: 0 24px 18px; }
.composer::before { content: ""; position: absolute; left: 0; right: 0; top: -28px; height: 28px; pointer-events: none;
  background: linear-gradient(180deg, rgba(245, 249, 250, 0), #f5f9fa); }
.composer-tray { max-width: 860px; margin: 0 auto; padding: 10px 10px 8px 16px; border-radius: 20px; background: var(--paper); border: 1px solid var(--hair-strong);
  box-shadow: var(--lift-2); transition: border-color .15s var(--ease), box-shadow .15s var(--ease); }
.composer-tray:focus-within { border-color: var(--interactive-44); box-shadow: var(--lift-2), 0 0 0 4px hsla(201, 85%, 44%, .12); }
.composer textarea { display: block; width: 100%; min-height: 28px; max-height: 220px; padding: 4px 0; border: 0; outline: none; resize: none; background: transparent;
  font-size: 17px; line-height: 1.45; color: var(--ink); }
.composer textarea::placeholder { color: hsl(200, 8%, 62%); }
.composer-bar { display: flex; align-items: center; gap: 8px; margin-top: 4px; margin-left: -8px; }
.composer-hint { flex: 1; min-width: 0; font-size: 13px; color: var(--neutral-52); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.send-btn { display: grid; place-items: center; width: 40px; height: 40px; border: 0; border-radius: 12px; cursor: pointer; color: var(--paper);
  background: linear-gradient(180deg, hsl(201, 80%, 38%), var(--interactive)); box-shadow: 0 6px 14px -6px hsla(201, 85%, 30%, .55);
  transition: transform .15s var(--ease), opacity .15s var(--ease); }
.send-btn:hover { background: linear-gradient(180deg, var(--interactive), var(--interactive-24)); }
.send-btn svg { width: 19px; height: 19px; }
.send-btn:active { transform: translateY(1px); }
.send-btn:disabled { opacity: .45; cursor: default; transform: none; }
.attachments { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 8px -6px; }
.attachments:empty { display: none; }
.file-chip { display: inline-flex; align-items: center; gap: 6px; max-width: 280px; height: 30px; padding: 0 4px 0 12px; border-radius: 999px; background: var(--primary-3495);
  border: 1px solid var(--primary-2485); font-size: 14px; color: var(--deep); }
.file-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-chip .icon-btn { width: 24px; height: 24px; border-radius: 50%; }
.file-chip svg { width: 15px; height: 15px; }
.jump { position: absolute; left: 50%; bottom: 128px; transform: translateX(-50%); display: grid; place-items: center; width: 40px; height: 40px; border: 1px solid var(--hair); border-radius: 50%;
  background: var(--paper); color: var(--interactive); box-shadow: var(--lift-2); cursor: pointer; z-index: 3; }
.dropzone { position: absolute; inset: 64px 12px 12px; display: grid; place-content: center; justify-items: center; gap: 8px; border: 2px dashed var(--interactive-44);
  border-radius: var(--r-l); background: hsla(201, 100%, 97%, .94); color: var(--interactive); font-size: 20px; font-weight: 600; z-index: 4; pointer-events: none; }
.dropzone svg { width: 36px; height: 36px; }

/* ============================================================ menus, dialog, toasts */
.menu-anchor { position: relative; }
.menu { position: absolute; top: calc(100% + 8px); left: 0; min-width: 280px; max-width: 360px; padding: 6px; background: var(--paper); border-radius: var(--r-m);
  border: 1px solid var(--hair); box-shadow: var(--lift-3); z-index: 40; animation: pop .14s var(--ease); }
.menu-up { top: auto; bottom: 4px; left: calc(100% + 10px); }
@keyframes pop { from { opacity: 0; transform: translateY(-4px) scale(.98); } to { opacity: 1; transform: none; } }
.menu-head { display: flex; align-items: center; gap: 12px; padding: 10px 10px 12px; border-bottom: 1px solid var(--hair); margin-bottom: 4px; }
.menu-avatar { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: var(--accent); color: var(--deep); font-weight: 700; }
.menu-title { font-weight: 600; }
.menu-sub { font-size: 14px; color: var(--neutral-52); }
.menu-item { display: flex; align-items: center; gap: 12px; width: 100%; padding: 9px 10px; border: 0; border-radius: 9px; background: none; text-align: left; font-size: 15.5px; cursor: pointer; }
.menu-item svg { width: 19px; height: 19px; color: var(--ink-soft); }
.menu-item:hover { background: var(--primary-3495); }
.menu-item small { margin-left: auto; color: var(--neutral-52); font-size: 13.5px; }
.menu-item.active { color: var(--deep); font-weight: 600; background: var(--primary-2491); }
.menu-sep { height: 1px; margin: 4px 0; background: var(--hair); }
#deleteAllChats:hover { background: var(--error-91); color: var(--error-50); }
#deleteAllChats:hover svg { color: var(--error-50); }

.modal { position: fixed; inset: 0; display: grid; place-items: center; padding: 16px; background: rgba(8, 30, 38, .42); backdrop-filter: blur(3px); z-index: 70;
  animation: fade .16s var(--ease); }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.modal-card { width: 100%; max-width: 420px; padding: 26px 26px 20px; border-radius: var(--r-xl); background: var(--paper); box-shadow: var(--lift-3); animation: pop .18s var(--ease); }
.modal-icon { width: 44px; height: 44px; border-radius: 14px; background: var(--error-91); color: var(--error-50); margin-bottom: 14px; }
.modal-card h3 { margin: 0 0 6px; font-size: 21px; font-weight: 600; color: var(--ink); }
.modal-card p { margin: 0 0 22px; font-size: 16px; color: var(--ink-soft); }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; }

.toasts { position: fixed; top: 44px; right: 16px; display: flex; flex-direction: column; gap: 10px; z-index: 80; width: min(400px, calc(100vw - 32px)); }
.toast { padding: 12px 16px; background: var(--paper); border-radius: var(--r-m); box-shadow: var(--lift-3); font-size: 15px; border-left: 4px solid var(--interactive);
  animation: pop .18s var(--ease); }
.toast.error { border-left-color: var(--error-50); }
.toast.success { border-left-color: var(--success-9532); }
.toast.warning { border-left-color: var(--warning-41); }

/* ============================================================ layout per width */
@media (min-width: 961px) {
  /* one header row as in Kinetic: title and fields give way (ellipsis) before the toolbar wraps */
  .page-head { flex-wrap: nowrap; }
  .title-block { flex: 0 12 auto; min-width: 0; }
  .title-block h1 { min-width: 0; }
  .head-fields { flex: none; }
  .head-field { min-width: 0; }
  .head-value { overflow: hidden; text-overflow: ellipsis; }
  .toolbar { flex: none; }
}
@media (max-width: 1180px) {
  .groups { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .title-block h1 { font-size: 30px; max-width: 30vw; }
  .head-field:nth-child(3) { display: none; }
}
@media (max-width: 960px) {
  :root { --rail: 56px; }
  .content { grid-template-columns: minmax(0, 1fr); padding: 10px 12px 12px; }
  .side { position: fixed; top: 0; bottom: 0; left: var(--rail); width: min(300px, 82vw); z-index: 30; border-radius: 0 var(--r-l) var(--r-l) 0;
    transform: translateX(calc(-100% - var(--rail) - 24px)); transition: transform .2s var(--ease); box-shadow: var(--lift-3); }
  .shell.side-open .side { transform: none; }
  .shell.side-open .scrim { display: block; position: fixed; inset: 0 0 0 var(--rail); background: rgba(8, 30, 38, .3); z-index: 25; }
  .page-head { padding: 10px 14px 6px; gap: 10px 18px; }
  .title-block h1 { max-width: 70vw; }
  .toolbar { margin-left: 0; }
  .tabs { padding: 4px 12px 0; }
  .context { max-width: 70%; }
  .crumbs { padding-left: 14px; }
}
@media (max-width: 640px) {
  :root { --rail: 52px; }
  body { font-size: 15px; }
  .rail-btn { width: 42px; height: 42px; }
  .title-block h1 { font-size: 26px; }
  .pill { height: 26px; font-size: 13.5px; padding: 0 10px; }
  .head-fields { width: 100%; }
  .head-field { padding: 0 12px; }
  .toolbar { width: 100%; justify-content: space-between; }
  .tab { padding: 8px 14px; font-size: 16px; }
  .groups, .suggestions { grid-template-columns: minmax(0, 1fr); }
  .card-band { padding: 8px 14px; min-height: 56px; }
  .card-band h2 { font-size: 18px; }
  .card-band .kbtn { padding: 0 12px; }
  .card-body { padding: 14px 14px 6px; }
  .chat-head { padding: 10px 10px 10px 14px; }
  .chat-head-meta { display: none; }
  .chat-head-actions .kbtn { padding: 0 12px; }
  .chat-head-actions .lbl { display: none; }
  .chat-head-actions .kbtn, .chat-head-actions .ghost-btn { width: 40px; padding: 0; justify-content: center; }
  .messages { padding: 16px 12px 12px; gap: 18px; }
  .msg { gap: 10px; }
  .msg-user .msg-body { max-width: 88%; }
  .welcome h3 { font-size: 30px; }
  .composer { padding: 0 10px 10px; }
  .composer-hint { display: none; }
  .composer-bar { justify-content: space-between; }
  .jump { bottom: 104px; }
  .login-panel { grid-template-columns: 1fr; min-height: 0; }
  .login-hero { padding: 26px 24px; }
  .login-hero h1 { margin-top: 12px; font-size: 26px; }
  .hero-points { display: none; }
  .login-form { padding: 26px 24px 30px; }
  .context { display: none; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
