/* Relayo Agent Panel. Šriftas ir prekės ženklo mėlyna kaip relayo.lt; aplink — rami, tanki
   darbo įrankio sąsaja: šoninė juosta, viršutinė juosta, kortelės ant šviesaus fono. */

@font-face {
  font-family: 'Geist';
  src: url('fonts/geist.woff2') format('woff2');
  font-weight: 300 500;
  font-style: normal;
  font-display: swap;
}

:root {
  --canvas: #f6f7f9;
  --bg: #ffffff;
  --sidebar: #fbfbfc;
  --surface: #f3f4f6;
  --surface-raised: #e9ebef;
  --hover: #eef0f3;
  --ink: #0f1115;
  --ink-muted: #4a4f58;
  --ink-subtle: #6b7079;
  --line: #e3e5e9;
  --line-strong: #d0d4da;
  --signal: #0066cc;
  --signal-hover: #0057ad;
  --signal-text: #0062c4;
  --signal-soft: #e8f1fc;
  --selection: #cfe3fb;
  --ok: #1a7f37;
  --ok-soft: #e6f4ea;
  --wait: #b35c00;
  --wait-soft: #fdf1e3;
  --warn: #9a4a00;
  --error: #c62828;
  --error-soft: #fdecec;
  --wire: #b4b9c0;
  --series-1: #2a78d6;
  --shadow-sm: 0 1px 2px rgb(16 24 40 / 0.05);
  --shadow-md: 0 6px 16px rgb(16 24 40 / 0.08), 0 1px 3px rgb(16 24 40 / 0.06);
  --shadow: 0 16px 48px rgb(16 24 40 / 0.16);

  --radius-control: 8px;
  --radius-block: 12px;
  --sidebar-w: 256px;
  --font: 'Geist', system-ui, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, monospace;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --canvas: #0b0c0e;
    --bg: #121417;
    --sidebar: #0e1012;
    --surface: #181b1f;
    --surface-raised: #20242a;
    --hover: #1a1d22;
    --ink: #eef0f3;
    --ink-muted: #a7acb4;
    --ink-subtle: #8a9099;
    --line: #23272d;
    --line-strong: #30353d;
    --signal-text: #5ea2ff;
    --signal-hover: #1a75d6;
    --signal-soft: #102540;
    --selection: #1f3c5e;
    --ok: #3fb950;
    --ok-soft: #12261a;
    --wait: #e3a23b;
    --wait-soft: #2a1f0f;
    --warn: #e8a85a;
    --error: #ff7b72;
    --error-soft: #2c1517;
    --wire: #454a52;
    --series-1: #3987e5;
    --shadow-sm: 0 1px 2px rgb(0 0 0 / 0.4);
    --shadow-md: 0 6px 16px rgb(0 0 0 / 0.45);
    --shadow: 0 16px 48px rgb(0 0 0 / 0.55);
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --canvas: #0b0c0e; --bg: #121417; --sidebar: #0e1012; --surface: #181b1f; --surface-raised: #20242a; --hover: #1a1d22;
  --ink: #eef0f3; --ink-muted: #a7acb4; --ink-subtle: #8a9099; --line: #23272d; --line-strong: #30353d;
  --signal-text: #5ea2ff; --signal-hover: #1a75d6; --signal-soft: #102540; --selection: #1f3c5e;
  --ok: #3fb950; --ok-soft: #12261a; --wait: #e3a23b; --wait-soft: #2a1f0f; --warn: #e8a85a; --error: #ff7b72; --error-soft: #2c1517;
  --wire: #454a52; --series-1: #3987e5; color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }

body {
  background: var(--canvas);
  color: var(--ink);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

::selection { background: var(--selection); }

h1 { font-size: 24px; font-weight: 500; letter-spacing: -0.015em; line-height: 1.25; }
h2 { font-size: 16px; font-weight: 500; letter-spacing: -0.005em; }
h3 { font-size: 12px; font-weight: 500; color: var(--ink-subtle); text-transform: uppercase; letter-spacing: 0.04em; margin-top: 18px; margin-bottom: 8px; }

code, .mono { font-family: var(--font-mono); font-size: 0.9em; }
code { padding: 1px 5px; border-radius: 5px; background: var(--surface); }
.muted { color: var(--ink-muted); }
.small { font-size: 13px; }
.warn { color: var(--warn); }
.error { color: var(--error); }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.label { font-size: 12px; color: var(--ink-subtle); letter-spacing: 0.01em; }

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.icon { flex: none; display: block; }

/* ── Apvalkalas: šoninė juosta, viršutinė juosta, turinys ─────────────── */

body.app {
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow-x: hidden;
  overflow-y: auto;
  border-right: 1px solid var(--line);
  background: var(--sidebar);
  scrollbar-width: thin;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 18px 14px;
  color: var(--ink);
  text-decoration: none;
}

.brand__mark { display: block; border-radius: 8px; box-shadow: 0 0 0 1px var(--line); }
.brand__text { display: grid; line-height: 1.2; }
.brand__name { font-size: 15px; font-weight: 500; letter-spacing: -0.01em; }
.brand__product { font-size: 12px; color: var(--ink-subtle); }

.sidebar__nav { display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; padding: 6px 10px 16px; }
.navsection, .navgroup, .navgroup__list > li { min-width: 0; }
.navsection { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1px; }
.navsection__title { padding: 0 10px 6px; font-size: 11px; font-weight: 500; color: var(--ink-subtle); text-transform: uppercase; letter-spacing: 0.06em; }
.navsection__empty { padding: 4px 10px; font-size: 13px; color: var(--ink-subtle); }

.navlink, .navgroup__head {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 32px;
  padding: 0 10px;
  border: 0;
  border-radius: 7px;
  background: none;
  color: var(--ink-muted);
  font: inherit;
  font-size: 13.5px;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 120ms ease-out, color 120ms ease-out;
}

.navlink:hover, .navgroup__head:hover { background: var(--hover); color: var(--ink); }
.navlink[aria-current="page"] { background: var(--bg); color: var(--ink); font-weight: 500; box-shadow: var(--shadow-sm), inset 0 0 0 1px var(--line); }
.navlink[aria-current="page"] .icon { color: var(--signal-text); }
.navlink__label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.navgroup__chev { display: inline-flex; color: var(--ink-subtle); transition: transform 150ms ease-out; }
.navgroup__head[aria-expanded="true"] .navgroup__chev { transform: rotate(90deg); }
.navgroup__list { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1px; margin: 1px 0 4px; padding: 0 0 0 17px; list-style: none; }
.navlink--agent { min-height: 30px; gap: 9px; padding-left: 12px; font-size: 13px; border-left: 1px solid var(--line); border-radius: 0 7px 7px 0; }
.navlink--agent.is-off { color: var(--ink-subtle); }

.badge {
  flex: none;
  min-width: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--wait);
  color: #fff;
  font-size: 11.5px;
  font-weight: 500;
  line-height: 18px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.sidebar__foot {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: auto;
  padding: 14px 16px 18px;
  border-top: 1px solid var(--line);
}

/* Būsenos taškas: dirba dabar (pulsuoja), laukia tavęs, ramybė, neįdiegta */
.dot {
  position: relative;
  flex: none;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ink-subtle);
  opacity: 0.55;
}

.dot--active { background: var(--ok); opacity: 1; }
.dot--active::after {
  content: "";
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  border: 2px solid var(--ok);
  opacity: 0;
  animation: pulse 1.8s ease-out infinite;
}
.dot--attention { background: var(--wait); opacity: 1; }
.dot--off { background: none; border: 1.5px dashed var(--ink-subtle); opacity: 0.7; }

@keyframes pulse {
  0% { transform: scale(0.6); opacity: 0.7; }
  100% { transform: scale(1.5); opacity: 0; }
}

.main { min-width: 0; display: flex; flex-direction: column; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 52px;
  padding: 0 28px;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--canvas) 86%, transparent);
  backdrop-filter: blur(10px);
}

.topbar .topbar__menu { display: none; }

.crumbs ol { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 0; list-style: none; font-size: 13px; color: var(--ink-subtle); }
.crumbs li + li::before { content: "/"; margin-right: 6px; color: var(--line-strong); }
.crumbs a { color: var(--ink-subtle); text-decoration: none; }
.crumbs a:hover { color: var(--ink); }
.crumbs [aria-current="page"] { color: var(--ink); font-weight: 500; }

.topbar__end { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.topbar__status { display: flex; gap: 6px; }
.topbar__updated { font-size: 12px; color: var(--ink-subtle); font-variant-numeric: tabular-nums; white-space: nowrap; }

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
  background: var(--bg);
  color: var(--ink-muted);
  cursor: pointer;
  transition: background-color 120ms ease-out, color 120ms ease-out, border-color 120ms ease-out;
}

.icon-btn:hover:not(:disabled) { color: var(--ink); border-color: var(--line-strong); background: var(--hover); }
.icon-btn:disabled .icon { animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.scrim { display: none; }

.content {
  width: 100%;
  max-width: 1320px;
  margin: 0 auto;
  padding: 28px 28px 72px;
}

.pagehead {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px 24px;
  margin-bottom: 24px;
}

.pagehead__text { min-width: 0; max-width: 80ch; }
.pagehead__text h1 { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; }
.pagehead__text > p { margin-top: 6px; }
.pagehead__eyebrow { margin-bottom: 4px; font-size: 12px; color: var(--ink-subtle); }
.pagehead__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.pagehead__actions .confirm { max-width: 420px; }

.status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--bg);
  color: var(--ink-muted);
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0;
  line-height: 20px;
}

.status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--ink-subtle); }
.status--live::before { background: var(--ok); }
.status--waiting::before { background: var(--wait); }
.status--planned::before { background: none; border: 1.5px dashed var(--ink-subtle); }
.status--postponed::before { opacity: 0.45; }

.skeleton { display: grid; gap: 16px; }
.skeleton__row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.skeleton__block { display: block; height: 180px; border-radius: var(--radius-block); background: linear-gradient(90deg, var(--surface) 0%, var(--hover) 50%, var(--surface) 100%); background-size: 200% 100%; animation: shimmer 1.4s ease-in-out infinite; }
.skeleton__block--kpi { height: 92px; }
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: -100% 0; } }

/* ── Mygtukai, nuorodos ────────────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 34px;
  padding: 0 14px;
  border: 1px solid var(--signal);
  border-radius: var(--radius-control);
  background: var(--signal);
  color: #fff;
  font: inherit;
  font-size: 13.5px;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: background-color 120ms ease-out, border-color 120ms ease-out, box-shadow 120ms ease-out;
}

.btn:hover:not(:disabled) { background: var(--signal-hover); border-color: var(--signal-hover); }
.btn:disabled { opacity: 0.5; cursor: default; }

.btn--quiet {
  border-color: var(--line-strong);
  background: var(--bg);
  color: var(--ink);
}

.btn--quiet:hover:not(:disabled) { background: var(--hover); border-color: var(--line-strong); }
.btn--quiet[aria-pressed="true"] { border-color: var(--signal-text); background: var(--signal-soft); color: var(--ink); }
.btn--danger, .btn--danger.btn--quiet { color: var(--error); }
.btn--danger:hover:not(:disabled) { border-color: var(--error); }
.btn--small { min-height: 28px; padding: 0 10px; font-size: 12.5px; }
a.btn { text-decoration: none; }

.link {
  padding: 0;
  border: 0;
  background: none;
  color: var(--signal-text);
  font: inherit;
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, currentColor 30%, transparent);
  text-underline-offset: 3px;
  cursor: pointer;
}

.link:hover { text-decoration-color: currentColor; }

:focus-visible {
  outline: 2px solid var(--signal-text);
  outline-offset: 2px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 1px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--bg);
  color: var(--ink-muted);
  font-size: 12px;
  line-height: 20px;
  text-decoration: none;
  white-space: nowrap;
}

.chip::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--dot, var(--ink-subtle)); }
.chip--ok { --dot: var(--ok); color: var(--ink); }
.chip--wait { --dot: var(--wait); color: var(--ink); }
.chip--warn { --dot: var(--error); color: var(--warn); }
.chip--demo { --dot: var(--signal-text); border-style: dashed; color: var(--ink); }
a.chip:hover { border-color: var(--line-strong); background: var(--hover); }

/* ── Žemėlapio būsenos ir agentų mazgai ────────────────────────────────── */

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--ink-muted);
  white-space: nowrap;
}

.pill::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--dot, var(--ink-subtle));
}

.pill--live { --dot: var(--ok); }
.pill--waiting { --dot: var(--wait); }
.pill--planned::before { background: none; border: 1.5px dashed var(--ink-subtle); }
.pill--postponed::before { background: var(--ink-subtle); opacity: 0.45; }

.summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 24px;
}

.filters { display: flex; flex-wrap: wrap; gap: 8px; }

.filter {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 32px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--bg);
  color: var(--ink);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
  transition: border-color 120ms ease-out, background-color 120ms ease-out;
}

.filter:hover { border-color: var(--line-strong); }
.filter[aria-pressed="true"] { border-color: var(--signal-text); background: var(--signal-soft); }
.filter__count { font-weight: 500; font-variant-numeric: tabular-nums; }
.summary__facts { display: flex; flex-wrap: wrap; gap: 4px 16px; }

.board-scroll { margin-top: 20px; overflow-x: auto; padding-bottom: 4px; }
.board { position: relative; min-width: 1120px; }
.wires { position: absolute; inset: 0; z-index: 0; pointer-events: none; overflow: visible; }
.wire { fill: none; stroke: var(--wire); stroke-width: 1.5; marker-end: url(#arrow); transition: stroke 150ms ease-out, opacity 150ms ease-out; }
.wire--plan { stroke-dasharray: 4 4; }
.arrow-head { fill: var(--wire); }
.arrow-on-head { fill: var(--signal-text); }
.wire.is-active { stroke: var(--signal-text); stroke-width: 2; marker-end: url(#arrow-on); }
.board.has-focus .wire:not(.is-active) { opacity: 0.35; }

.stages { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 40px; }
.stage { padding: 12px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.stage__title { margin: 2px 4px 12px; font-size: 12px; font-weight: 500; color: var(--ink-subtle); text-transform: uppercase; letter-spacing: 0.05em; }
.stage__nodes { display: grid; gap: 28px; }
.lane { margin-top: 40px; padding: 12px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.lane__nodes { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 16px 40px; }

.node {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 8px;
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-block);
  background: var(--bg);
  color: var(--ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: border-color 120ms ease-out, box-shadow 120ms ease-out, opacity 150ms ease-out;
}

.node:hover { border-color: var(--line-strong); box-shadow: var(--shadow-md); }
.node[aria-pressed="true"] { border-color: var(--signal-text); box-shadow: 0 0 0 1px var(--signal-text); }
.node--live { border-color: color-mix(in srgb, var(--ok) 45%, var(--line)); }
.node--planned, .node--postponed { border-style: dashed; border-color: var(--line-strong); background: var(--surface); box-shadow: none; }
.node--postponed .node__name { color: var(--ink-muted); }
.board.has-focus .node:not(.is-related) { opacity: 0.45; }
.board[data-filter="live"] .node:not([data-status="live"]),
.board[data-filter="waiting"] .node:not([data-status="waiting"]),
.board[data-filter="planned"] .node:not([data-status="planned"]),
.board[data-filter="postponed"] .node:not([data-status="postponed"]) { opacity: 0.25; }
.node__head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; }
.node__plan { font-family: var(--font-mono); font-size: 12px; color: var(--ink-subtle); }
.node__name { font-weight: 500; line-height: 1.3; }
.node__you { padding: 0 7px; border-radius: 6px; background: var(--signal-soft); color: var(--ink); font-size: 11px; font-weight: 500; line-height: 18px; }
.node__summary { color: var(--ink-muted); font-size: 13px; line-height: 1.45; }
.node__from { color: var(--ink-subtle); }
.node__foot { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; }
.node__open { font-size: 12px; color: var(--warn); }
.node__engine { margin-left: auto; font-size: 12px; color: var(--ink-subtle); }

.drawer {
  position: fixed;
  inset: 0 0 0 auto;
  z-index: 40;
  width: min(440px, 100vw);
  overflow-y: auto;
  padding: 24px;
  border-left: 1px solid var(--line);
  background: var(--bg);
  box-shadow: var(--shadow);
}

.drawer[hidden] { display: none; }
.drawer__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.drawer__head h2 { font-size: 20px; margin-top: 2px; }
.drawer__close { min-width: 34px; padding: 0; }
.drawer__status { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; margin: 12px 0 16px; }
.drawer__open { margin-top: 20px; }

/* ── Bendri blokai ─────────────────────────────────────────────────────── */

.facts {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 6px 16px;
  margin-top: 12px;
  font-size: 13.5px;
}

.facts dt { color: var(--ink-subtle); }
.facts dd { min-width: 0; overflow-wrap: anywhere; }

.checks, .refs { display: grid; gap: 7px; padding: 0; list-style: none; font-size: 13.5px; }
.check { display: grid; grid-template-columns: 18px 1fr; gap: 8px; }
.check__mark { font-weight: 500; text-align: center; }
.check--ok .check__mark { color: var(--ok); }
.check--fail .check__mark { color: var(--warn); }
.check--unknown .check__mark, .check--todo .check__mark { color: var(--ink-subtle); }
.check__detail { display: block; }

.note {
  margin-top: 14px;
  padding: 10px 12px;
  border-radius: var(--radius-control);
  background: var(--surface);
  color: var(--ink-muted);
}

.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.actions + .muted { margin-top: 8px; }

.action-result { margin-top: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-control); }
.action-result.is-ok p { color: var(--ok); }
.action-result.is-fail p { color: var(--warn); }
.action-result summary { margin-top: 6px; cursor: pointer; color: var(--ink-muted); }
.action-result pre { max-height: 260px; margin-top: 8px; overflow: auto; font-size: 12px; white-space: pre-wrap; }

.block { margin-top: 40px; padding-top: 24px; border-top: 1px solid var(--line); }
.block > h2 { margin-bottom: 16px; }
.block > .muted { margin-top: 8px; }

.panel:focus { outline: none; }
/* Vienodas tarpas tarp rodinio blokų; skiltys (.section) turi savo, didesnį. */
.panel > * + *:not(.section) { margin-top: 16px; }
.lead { font-size: 15px; color: var(--ink-muted); margin-bottom: 8px; }
.section { margin-top: 28px; }
.section:first-child { margin-top: 0; }
.section > h2 { margin-bottom: 6px; font-size: 17px; }
.section > .muted { margin-bottom: 12px; }

.section__head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px 16px;
  margin-bottom: 12px;
}

.section__head h3 { margin-top: 0; }

.grid { display: grid; gap: 16px; align-items: start; }

@media (min-width: 900px) {
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .card--wide { grid-column: 1 / -1; }
}

.stack { display: grid; gap: 16px; align-content: start; min-width: 0; }

.card {
  display: grid;
  gap: 12px;
  align-content: start;
  min-width: 0;
  margin: 0;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius-block);
  background: var(--bg);
  box-shadow: var(--shadow-sm);
}

.card__title { font-size: 14.5px; font-weight: 500; color: var(--ink); margin: 0; padding: 0; text-transform: none; letter-spacing: -0.005em; }
.card__head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; }
legend.card__title { float: left; width: 100%; margin-bottom: 4px; }
legend.card__title + * { clear: both; }
details.card > summary { cursor: pointer; }
details.card:not([open]) { gap: 0; }
.card .facts { margin-top: 0; }
.card .actions { margin-top: 2px; }
.card h3 { margin-top: 10px; }

.status-line { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; }

.flash { padding: 8px 12px; border-radius: var(--radius-control); background: var(--surface); font-size: 13.5px; }
.flash.is-ok { background: var(--ok-soft); }
.flash.is-ok > p { color: var(--ok); }
.flash.is-fail { background: var(--wait-soft); }
.flash.is-fail > p { color: var(--warn); }
.flash details { margin-top: 6px; color: var(--ink-muted); }

.banner {
  margin-bottom: 12px;
  padding: 10px 14px;
  border: 1px solid color-mix(in srgb, var(--wait) 35%, var(--line));
  border-radius: var(--radius-control);
  background: var(--wait-soft);
}

.banner.is-fail { border-color: color-mix(in srgb, var(--error) 40%, var(--line)); background: var(--error-soft); }
.banner pre { margin-top: 8px; white-space: pre-wrap; }
.banner .actions { margin-top: 8px; }

.callout {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 24px;
  padding: 16px 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius-block);
  background: var(--bg);
  box-shadow: var(--shadow-sm);
}

.callout h2 { font-size: 14.5px; }

.confirm {
  display: grid;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-control);
  background: var(--surface);
}

.tag {
  display: inline-block;
  margin-left: 8px;
  padding: 0 7px;
  border-radius: 6px;
  background: var(--surface-raised);
  color: var(--ink-muted);
  font-size: 11.5px;
  line-height: 20px;
  white-space: nowrap;
}

.tag--verified, .tag--won, .tag--deploy-veikia { background: var(--ok-soft); color: var(--ok); }
.tag--risky, .tag--guess, .tag--deploy-pilotas { background: var(--wait-soft); color: var(--warn); }
.tag--variant { margin-left: 0; background: var(--signal-soft); color: var(--ink); font-weight: 500; }
.label .tag--variant { margin-left: 8px; }
.tag--invalid { background: var(--error-soft); color: var(--error); }
.tag--sent, .tag--deploy-bandymas { background: var(--signal-soft); color: var(--signal-text); }
.tag--lost, .tag--deploy-sustabdyta { background: var(--surface-raised); color: var(--ink-subtle); }
.tag--wait { background: var(--wait-soft); color: var(--warn); }

.seg { display: inline-flex; padding: 2px; border: 1px solid var(--line); border-radius: var(--radius-control); background: var(--surface); }
.seg__btn { min-height: 26px; padding: 0 10px; border: 0; border-radius: 6px; background: none; color: var(--ink-muted); font: inherit; font-size: 12.5px; cursor: pointer; }
.seg__btn[aria-pressed="true"] { background: var(--bg); color: var(--ink); box-shadow: var(--shadow-sm); }

/* ── Rodikliai ─────────────────────────────────────────────────────────── */

.kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
}

.kpi {
  display: grid;
  align-content: start;
  gap: 4px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-block);
  background: var(--bg);
  color: var(--ink);
  text-decoration: none;
  box-shadow: var(--shadow-sm);
  transition: border-color 120ms ease-out, box-shadow 120ms ease-out;
}

a.kpi:hover { border-color: var(--line-strong); box-shadow: var(--shadow-md); }
.kpi__label { font-size: 12px; color: var(--ink-subtle); }
.kpi__value { font-size: 26px; font-weight: 500; letter-spacing: -0.02em; line-height: 1.15; font-variant-numeric: tabular-nums; }
.kpi__sub { font-size: 12.5px; color: var(--ink-muted); }
.kpi--ok .kpi__value { color: var(--ok); }
.kpi--warn .kpi__value { color: var(--warn); }
.kpi--wait .kpi__value { color: var(--wait); }

.bar { height: 6px; margin-top: 6px; border-radius: 3px; background: var(--surface-raised); overflow: hidden; }
.bar__fill { display: block; height: 100%; border-radius: 3px; background: var(--signal-text); transition: width 400ms ease-out; }
.bar--big { height: 8px; border-radius: 4px; }
.bar__fill--warn { background: var(--wait); }

/* ── Agento puslapis ───────────────────────────────────────────────────── */

.now {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 24px;
  padding: 16px 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius-block);
  background: var(--bg);
  box-shadow: var(--shadow-sm);
}

.now--active { border-color: color-mix(in srgb, var(--ok) 35%, var(--line)); background: linear-gradient(90deg, var(--ok-soft), var(--bg) 60%); }
.now--attention { border-color: color-mix(in srgb, var(--wait) 35%, var(--line)); background: linear-gradient(90deg, var(--wait-soft), var(--bg) 60%); }
.now__main { display: flex; align-items: flex-start; gap: 14px; min-width: 0; }
.now__pulse { position: relative; flex: none; width: 12px; height: 12px; margin-top: 4px; border-radius: 50%; background: var(--ink-subtle); opacity: 0.5; }
.now--active .now__pulse { background: var(--ok); opacity: 1; }
.now--active .now__pulse::after { content: ""; position: absolute; inset: -4px; border: 2px solid var(--ok); border-radius: 50%; animation: pulse 1.8s ease-out infinite; }
.now--attention .now__pulse { background: var(--wait); opacity: 1; }
.now--off .now__pulse { background: none; border: 1.5px dashed var(--ink-subtle); }
.now__label { font-size: 12px; font-weight: 500; color: var(--ink-subtle); text-transform: uppercase; letter-spacing: 0.05em; }
.now--active .now__label { color: var(--ok); }
.now--attention .now__label { color: var(--warn); }
.now__text { margin-top: 2px; font-size: 16px; font-weight: 500; }
.now__since { margin-top: 2px; font-size: 12.5px; color: var(--ink-subtle); }
.now__meta { display: flex; flex-wrap: wrap; gap: 6px; }
.now .flash { flex-basis: 100%; }

.agent-layout { display: grid; gap: 16px; align-items: start; }
.agent-layout__main, .agent-layout__side { display: grid; gap: 16px; align-content: start; min-width: 0; }

@media (min-width: 1100px) {
  .agent-layout { grid-template-columns: minmax(0, 1fr) 340px; }
  .agent-layout__side { position: sticky; top: 72px; }
}

.about h3:first-of-type { margin-top: 8px; }

.timeline { display: grid; gap: 14px; padding: 0; list-style: none; }
.timeline__date { margin-bottom: 4px; font-size: 12px; font-weight: 500; color: var(--ink-subtle); }
.timeline__day > ul { display: grid; padding: 0; list-style: none; }

.timeline__item {
  position: relative;
  display: grid;
  grid-template-columns: 44px 14px minmax(0, 1fr);
  align-items: start;
  gap: 8px;
  padding: 6px 0;
  font-size: 13.5px;
}

.timeline__item::before { content: ""; position: absolute; left: 58px; top: 0; bottom: 0; width: 1px; background: var(--line); }
.timeline__day > ul > .timeline__item:first-child::before { top: 14px; }
.timeline__day > ul > .timeline__item:last-child::before { bottom: calc(100% - 14px); }
.timeline__time { padding-top: 1px; color: var(--ink-subtle); font-size: 12px; font-variant-numeric: tabular-nums; }
.timeline__dot { position: relative; z-index: 1; width: 9px; height: 9px; margin: 5px 0 0 1px; border: 2px solid var(--bg); border-radius: 50%; background: var(--series-1); box-shadow: 0 0 0 1px var(--line); }
.timeline__item.is-fail .timeline__dot { background: var(--error); }
.timeline__item.is-fail .timeline__body > p:first-child { color: var(--warn); }
.timeline__body { min-width: 0; overflow-wrap: anywhere; }

.doclist { display: grid; padding: 0; list-style: none; }
.doclist__item { display: grid; gap: 2px; width: 100%; padding: 9px 0; border: 0; border-bottom: 1px solid var(--line); background: none; color: var(--ink); font: inherit; text-align: left; cursor: pointer; }
.doclist li:last-child .doclist__item { border-bottom: 0; }
.doclist__item:hover .doclist__title { color: var(--signal-text); }
.doclist__title { font-weight: 500; }
.doclist__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 12.5px; color: var(--ink-subtle); }
.doclist__meta .tag { margin-left: 0; }

.agent-rows { display: grid; padding: 0; list-style: none; }

.agent-row {
  display: grid;
  grid-template-columns: 12px minmax(160px, 220px) minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 9px 8px;
  border-bottom: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
  text-decoration: none;
  font-size: 13.5px;
}

.agent-rows li:last-child .agent-row { border-bottom: 0; }
.agent-row:hover { background: var(--hover); }
.agent-row__name { display: grid; font-weight: 500; line-height: 1.3; }
.agent-row__stage { font-size: 11.5px; font-weight: 400; color: var(--ink-subtle); }
.agent-row__text { color: var(--ink-muted); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.agent-row__chev { color: var(--ink-subtle); }

.setup-steps { display: grid; gap: 10px; padding-left: 20px; }
.setup-steps li { display: list-item; padding-left: 4px; }
.setup-steps li > * { display: block; }
.setup-steps li::marker { color: var(--ink-subtle); font-variant-numeric: tabular-nums; }
.setup-steps li.is-done strong::after { content: " ✓"; color: var(--ok); }

.token-once { display: grid; gap: 8px; padding: 12px; border: 1px solid color-mix(in srgb, var(--wait) 35%, var(--line)); border-radius: var(--radius-control); background: var(--wait-soft); }
.token-once input { width: 100%; min-height: 34px; padding: 0 10px; border: 1px solid var(--line-strong); border-radius: var(--radius-control); background: var(--bg); color: var(--ink); font-size: 12.5px; }

/* ── Diagrama ──────────────────────────────────────────────────────────── */

.chart { display: grid; gap: 6px; margin: 0; }
.chart__title { font-size: 12px; color: var(--ink-subtle); }
.chart__plot { position: relative; }
.chart__svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart__bar { fill: var(--series-1); }
.chart__grid { stroke: var(--line); stroke-width: 1; stroke-dasharray: 2 3; }
.chart__base { stroke: var(--line-strong); stroke-width: 1; }
.chart__tick { fill: var(--ink-subtle); font-size: 10.5px; font-family: var(--font); font-variant-numeric: tabular-nums; }
.chart__hit { fill: transparent; cursor: default; }
.chart__hit:hover { fill: color-mix(in srgb, var(--series-1) 8%, transparent); }
.chart__tip {
  position: absolute;
  top: -6px;
  z-index: 2;
  display: grid;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
  background: var(--bg);
  box-shadow: var(--shadow-md);
  font-size: 12px;
  white-space: nowrap;
  transform: translate(-50%, -100%);
  pointer-events: none;
}
.chart__tip[hidden] { display: none; }
.chart__tip strong { font-size: 13px; font-weight: 500; }
.chart__tip span { color: var(--ink-subtle); }
.chart__table summary { color: var(--ink-subtle); font-size: 12px; }
.chart__table .table { max-width: 320px; margin-top: 6px; }

/* ── Laiškai tvirtinimui, pokalbiai ────────────────────────────────────── */

.draft__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.draft__company { margin: 2px 0 0; font-size: 16px; font-weight: 500; color: var(--ink); text-transform: none; letter-spacing: -0.005em; }

.score {
  min-width: 42px;
  padding: 4px 8px;
  border-radius: var(--radius-control);
  background: var(--signal-soft);
  color: var(--signal-text);
  font-size: 15px;
  font-weight: 500;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.draft__footer { padding: 8px 12px; border-left: 2px solid var(--line-strong); color: var(--ink-muted); white-space: pre-wrap; }
.draft__context summary, details > summary { cursor: pointer; color: var(--ink-muted); }
.draft__context .facts { margin-top: 8px; }

.thread { display: grid; gap: 8px; padding: 0; list-style: none; }
.thread__msg { max-width: 80ch; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-control); background: var(--bg); }
.thread__msg.is-ours { margin-left: 32px; background: var(--surface); }
.thread__text { white-space: pre-wrap; font-size: 13.5px; }

.signal-group { margin-top: 20px; }
.signals { display: grid; padding: 0; list-style: none; border-top: 1px solid var(--line); }
.signal { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.signal .actions { align-items: center; }
.signal-group details { margin-top: 8px; }

/* ── Formos ────────────────────────────────────────────────────────────── */

.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px 16px; align-items: start; }
.field { display: grid; gap: 5px; min-width: 0; }

.field select, .field textarea,
.field input:not([type="checkbox"]), .table input:not([type="checkbox"]) {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-control);
  background: var(--bg);
  color: var(--ink);
  font: inherit;
  font-size: 13.5px;
  transition: border-color 120ms ease-out, box-shadow 120ms ease-out;
}

.field select, .field input:not([type="checkbox"]), .table input:not([type="checkbox"]) { min-height: 34px; padding: 0 10px; }
.field select { max-width: 100%; }
.field textarea { min-height: 220px; padding: 10px 12px; line-height: 1.6; resize: vertical; }
.card .field textarea { min-height: 0; padding: 8px 10px; }
.field select:hover, .field textarea:hover, .field input:hover:not(:disabled), .table input:hover { border-color: var(--ink-subtle); }
.field select:focus-visible, .field textarea:focus-visible, .field input:focus-visible, .table input:focus-visible { outline: none; border-color: var(--signal-text); box-shadow: 0 0 0 3px color-mix(in srgb, var(--signal-text) 20%, transparent); }
.field input:disabled { background: var(--surface); color: var(--ink-muted); }
.field input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--signal); }
.field--short { max-width: 220px; }
.card .field select, .form-grid .field select { width: 100%; }
.input--small { min-height: 30px !important; margin-top: 4px; font-size: 12.5px !important; }
.field__row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.field__row input { flex: 1; }
.field__row .tag { margin-left: 0; }
.field.is-placeholder input, .field.is-placeholder textarea { border-color: var(--wait); }

.check-field { display: inline-flex; align-items: center; gap: 8px; min-height: 32px; font-size: 13.5px; }
.check-field input { width: 16px; height: 16px; accent-color: var(--signal); }

.save-bar {
  position: sticky;
  bottom: 0;
  z-index: 5;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px 12px;
  margin-top: 16px;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-block);
  background: color-mix(in srgb, var(--bg) 94%, transparent);
  backdrop-filter: blur(8px);
  box-shadow: var(--shadow-md);
}

.save-bar .flash { margin-right: auto; }
.estimate { padding: 10px 12px; border-radius: var(--radius-control); background: var(--surface); }
.estimate ul { margin-top: 6px; padding-left: 18px; }

.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px 20px; padding: 0; list-style: none; }
.step__head { display: flex; justify-content: space-between; gap: 8px; font-size: 13.5px; }
.step--done .bar__fill { background: var(--ok); }
.step--running .bar__fill { background: linear-gradient(90deg, var(--signal-text), color-mix(in srgb, var(--signal-text) 55%, var(--bg)), var(--signal-text)); background-size: 200% 100%; animation: shimmer 1.2s linear infinite; }
.step--running .step__head > span:first-child::after { content: " · running"; color: var(--signal-text); font-size: 12px; }

.log { max-height: 340px; margin-top: 8px; padding: 10px 12px; overflow: auto; border-radius: var(--radius-control); background: var(--surface); font-size: 12px; white-space: pre-wrap; }

/* ── Lentelės ──────────────────────────────────────────────────────────── */

.table-scroll { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th, .table td { padding: 9px 12px 9px 0; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.table thead th { padding-top: 0; color: var(--ink-subtle); font-size: 12px; font-weight: 400; }
.table th.num, .table td.num { text-align: right; }
.table tbody th { font-weight: 500; white-space: nowrap; }
.table tbody tr:hover > * { background: color-mix(in srgb, var(--hover) 60%, transparent); }
.table tbody tr:last-child > * { border-bottom: 0; }

.fields { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.fields th, .fields td { padding: 6px 0; border-top: 1px solid var(--line); text-align: left; vertical-align: top; }
.fields th { width: 42%; padding-right: 12px; color: var(--ink-subtle); font-weight: 400; }
.fields tr.is-empty td { color: var(--ink-subtle); }

/* ── Klientų agentai ───────────────────────────────────────────────────── */

.tester-grid { display: grid; gap: 24px; }
.tester { display: grid; align-content: start; gap: 14px; }
.tester__row { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px 16px; }
.tester__submit { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; }
.tester-output { min-height: 160px; padding: 16px; border: 1px solid var(--line); border-radius: var(--radius-block); background: var(--surface); }
.tester-output:focus { outline: none; }
.result-head { display: grid; gap: 6px; margin-bottom: 12px; }
.miss { display: inline-block; margin: 2px 6px 2px 0; padding: 0 9px; border: 1px dashed var(--ink-subtle); border-radius: 10px; color: var(--ink-muted); font-size: 12.5px; line-height: 22px; }
.reply { padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius-control); background: var(--bg); line-height: 1.6; white-space: pre-wrap; }

.split { display: grid; gap: 20px; }
@media (min-width: 1000px) { .split { grid-template-columns: 270px minmax(0, 1fr); } }
.split__list { display: grid; gap: 10px; align-content: start; }
.split__list > .btn { justify-content: flex-start; }
.split__list > .btn[aria-pressed="true"] { border-color: var(--signal-text); background: var(--signal-soft); }
.split__list h3 { margin-bottom: 0; }
.split__main { display: grid; gap: 16px; align-content: start; min-width: 0; }

.list { display: grid; gap: 6px; padding: 0; list-style: none; }
.list__item { display: grid; gap: 2px; width: 100%; padding: 9px 12px; border: 1px solid var(--line); border-radius: var(--radius-control); background: var(--bg); color: var(--ink); font: inherit; text-align: left; cursor: pointer; transition: border-color 120ms ease-out, background-color 120ms ease-out; }
.list__item:hover { border-color: var(--line-strong); background: var(--hover); }
.list__item[aria-pressed="true"] { border-color: var(--signal-text); box-shadow: 0 0 0 1px var(--signal-text); background: var(--bg); }
.list__name { font-weight: 500; }

.config-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 8px 16px; }
.config-head h2 { font-size: 20px; }
.subtabs { display: flex; flex-wrap: wrap; gap: 6px; }
.subtab { min-height: 32px; padding: 0 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--bg); color: var(--ink-muted); font: inherit; font-size: 13px; cursor: pointer; }
.subtab:hover { border-color: var(--line-strong); color: var(--ink); }
.subtab[aria-selected="true"] { border-color: var(--signal-text); background: var(--signal-soft); color: var(--ink); }
.editor { display: grid; gap: 16px; }
.field-table td { min-width: 90px; }
.field-table td:nth-child(3) { min-width: 220px; }
.add-field { padding-top: 8px; border-top: 1px solid var(--line); }
.add-field h3 { margin-top: 4px; }
.chips { display: flex; flex-wrap: wrap; gap: 4px 12px; }
.json { width: 100%; padding: 10px 12px; border: 1px solid var(--line-strong); border-radius: var(--radius-control); background: var(--bg); color: var(--ink); font-size: 12px; line-height: 1.5; }
.examples { display: grid; gap: 8px; padding: 0; list-style: none; }
.examples summary { cursor: pointer; }
.example { display: grid; gap: 10px; margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--line); }
.example h3 { margin-top: 0; }
.example-actions { margin-top: 16px; }

/* ── Apžvalga ──────────────────────────────────────────────────────────── */

.checklist { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 8px 32px; }
.checklist__group h3 { margin-top: 12px; }
.check__box { width: 16px; height: 16px; margin-top: 3px; accent-color: var(--ok); cursor: pointer; }

.funnel { display: grid; gap: 8px; padding: 0; list-style: none; }
.funnel__row { display: grid; grid-template-columns: minmax(120px, 1.2fr) 2fr 70px; align-items: center; gap: 12px; font-size: 13.5px; }
.funnel__bar { height: 8px; border-radius: 4px; background: var(--surface-raised); overflow: hidden; }
.funnel__fill { display: block; height: 100%; border-radius: 4px; background: var(--series-1); }
.funnel__n { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }

.gauge { display: grid; gap: 4px; }
.gauge__head { display: flex; justify-content: space-between; font-size: 13.5px; }

.activity { display: grid; padding: 0; list-style: none; }
.activity__item { display: grid; grid-template-columns: 110px max-content 1fr; align-items: baseline; gap: 4px 12px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.activity__item:last-child { border-bottom: 0; }
.activity__item .tag { margin-left: 0; }
.activity__item.is-fail > span:last-child { color: var(--warn); }

.subnav { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 18px; }
.subnav .link { padding: 4px 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--bg); color: var(--ink-muted); text-decoration: none; }
.subnav .link:hover { border-color: var(--line-strong); color: var(--ink); }
.inline-field { display: inline-flex; align-items: center; gap: 6px; color: var(--ink-muted); }
.inline-field select { min-height: 34px; padding: 0 8px; border: 1px solid var(--line-strong); border-radius: var(--radius-control); background: var(--bg); color: var(--ink); font: inherit; font-size: 13.5px; }
.input--num { max-width: 110px; text-align: right; }
.price-edit td { min-width: 90px; }
.price-edit td:first-child { min-width: 220px; }
.price-edit td:last-child { min-width: 220px; }
.price-edit select { max-width: 220px; min-height: 34px; border: 1px solid var(--line-strong); border-radius: var(--radius-control); background: var(--bg); color: var(--ink); font: inherit; font-size: 13.5px; }
.price-edit textarea { width: 100%; min-width: 220px; padding: 6px 8px; border: 1px solid var(--line-strong); border-radius: var(--radius-control); background: var(--bg); color: var(--ink); font: inherit; font-size: 13.5px; }
.steps-list { margin: 0; padding-left: 18px; display: grid; gap: 2px; }

/* ── Įmonės ────────────────────────────────────────────────────────────── */

.filterbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 10px 12px;
  margin-bottom: 12px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-block);
  background: var(--bg);
  box-shadow: var(--shadow-sm);
}

.filterbar .field { min-width: 150px; }
.filterbar__search { flex: 1 1 260px; }
.field--narrow { max-width: 110px; min-width: 90px !important; }
.filterbar__clear { margin-bottom: 1px; }

.companies { background: var(--bg); }
.table-scroll:has(.companies) { border: 1px solid var(--line); border-radius: var(--radius-block); background: var(--bg); box-shadow: var(--shadow-sm); }
.companies th, .companies td { padding-left: 12px; }
.companies thead th { padding-top: 10px; }
.companies th[scope="row"] { white-space: normal; }
.companies__name { display: block; font-weight: 500; text-align: left; text-decoration: none; }
.companies__name:hover { text-decoration: underline; }
.companies__row.is-open > * { border-bottom-color: transparent; background: var(--surface); }
.companies__detail > td { padding: 0 0 16px; background: var(--surface); }
.company-detail { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 8px 32px; padding: 4px 16px 0; }
.company-detail__actions { grid-column: 1 / -1; }
.pager { display: flex; align-items: center; justify-content: center; gap: 16px; margin-top: 12px; }

.empty { display: grid; justify-items: start; gap: 8px; max-width: 64ch; padding: 32px; border: 1px dashed var(--line-strong); border-radius: var(--radius-block); background: var(--bg); }
.empty--wide { max-width: none; }

/* ── Pardavimai: santrauka ir pasiūlymas ───────────────────────────────── */

.edit-row { display: grid; grid-template-columns: 1fr auto; align-items: start; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.totals { padding: 10px 12px; border-radius: var(--radius-control); background: var(--surface); }
.totals.is-stale { opacity: 0.6; }
.totals ul { margin-top: 6px; padding-left: 18px; }
.history summary { cursor: pointer; }
.history__row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--line); }

.doc {
  display: grid;
  gap: 10px;
  padding: 32px 36px;
  border: 1px solid var(--line);
  border-radius: var(--radius-block);
  background: var(--bg);
  box-shadow: var(--shadow-sm);
  line-height: 1.6;
}

.doc h2 { font-size: 22px; letter-spacing: -0.01em; }
.doc h3 { margin: 14px 0 0; font-size: 14.5px; color: var(--ink); text-transform: none; letter-spacing: 0; }
.doc ul, .doc ol { display: grid; gap: 6px; margin: 0; padding-left: 20px; }
.doc .facts { margin-top: 4px; }
.hypotheses > li { display: grid; gap: 2px; }
.hypotheses p { margin: 0; }
.price-table td, .price-table th { vertical-align: top; }
.price-table .num { white-space: nowrap; }
.price-table__total th, .price-table__total td { font-weight: 500; border-bottom: 0; border-top: 2px solid var(--ink); }
.doc__signature { margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--line); color: var(--ink-muted); }
.doc-actions { margin-bottom: 4px; }

@media (min-width: 1000px) {
  .tester-grid { grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); }
}

/* ── Siauras ekranas ───────────────────────────────────────────────────── */

@media (max-width: 960px) {
  body.app { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: fixed; inset: 0 auto 0 0; width: min(var(--sidebar-w), 86vw); transform: translateX(-100%); transition: transform 200ms ease-out; box-shadow: var(--shadow); }
  body.nav-open .sidebar { transform: none; }
  body.nav-open .scrim { position: fixed; inset: 0; z-index: 25; display: block; background: rgb(0 0 0 / 0.35); }
  .topbar { padding: 0 16px; }
  .topbar .topbar__menu { display: inline-grid; }
  .topbar__updated { display: none; }
  .content { padding: 20px 16px 56px; }
}

@media (max-width: 760px) {
  h1 { font-size: 21px; }
  .crumbs { min-width: 0; }
  .crumbs li:not(:last-child) { display: none; }
  .crumbs li:last-child::before { display: none; }
  .crumbs [aria-current="page"] { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .kpi { padding: 12px 14px; }
  .kpi__value { font-size: 22px; }
  .activity__item { grid-template-columns: 1fr; }
  .funnel__row { grid-template-columns: 1fr 70px; }
  .funnel__bar { grid-column: 1 / -1; grid-row: 2; }
  .agent-row { grid-template-columns: 12px minmax(0, 1fr) auto; }
  .agent-row__text { grid-column: 2 / -1; grid-row: 2; white-space: normal; }
  .doc { padding: 20px; }
  .board { min-width: 0; }
  .wires { display: none; }
  .stages { grid-template-columns: 1fr; gap: 16px; }
  .stage__nodes { gap: 12px; }
  .lane { margin-top: 16px; }
  .lane__nodes { grid-template-columns: 1fr; gap: 12px; }
}

@media print {
  body, body.app { display: block; background: #fff; color: #000; }
  .sidebar, .topbar, .scrim, .pagehead, .split__list, .doc-actions, .flash, .no-print, .banner { display: none !important; }
  .content { padding: 0; max-width: none; }
  .split { display: block; }
  .doc { border: 0; padding: 0; box-shadow: none; }
  .doc a { color: inherit; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* Diegimo vedlys (R5) */
.wizard-steps { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 16px; padding: 0; list-style: none; }
.wizard-steps__item { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px 6px 6px; border: 1px solid var(--line); border-radius: 999px; background: var(--bg); color: var(--ink-muted); font: inherit; font-size: 13.5px; cursor: pointer; }
.wizard-steps__item:hover { border-color: var(--line-strong); background: var(--hover); }
.wizard-steps__item[aria-current="step"] { border-color: var(--signal-text); color: var(--ink); box-shadow: 0 0 0 1px var(--signal-text); }
.wizard-steps__num { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--surface); font-size: 12px; font-variant-numeric: tabular-nums; }
.wizard-steps__num.is-done { background: var(--ok-soft); color: var(--ok); }
.choice { display: flex; align-items: flex-start; gap: 10px; padding: 6px 0; cursor: pointer; }
.choice input { margin-top: 3px; }
.choice__desc { display: block; }
.problems { margin: 0 0 12px; padding-left: 18px; display: grid; gap: 4px; font-size: 13.5px; }
.linklike { padding: 0; border: 0; background: none; color: var(--signal-text); font: inherit; text-decoration: underline; cursor: pointer; }
pre.draft { margin-top: 8px; padding: 10px 12px; border-radius: var(--radius-control); background: var(--surface); white-space: pre-wrap; font: inherit; }
.colmap { display: grid; gap: 8px; margin-bottom: 12px; }
.colmap__row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.5fr) auto; gap: 8px; align-items: center; }
.colmap__row select { min-height: 36px; }
@media (max-width: 640px) {
  .colmap__head { display: none; }
  .colmap__row { grid-template-columns: minmax(0, 1fr) auto; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
  .colmap__value { grid-column: 1 / -1; grid-row: 2; }
}

/* #9 diagnostikos taisymas */
.diag-edit { display: grid; gap: 10px; margin-bottom: 12px; }
.diag-edit.is-removed { opacity: .55; }
.diag-edit legend { padding: 0 4px; }

/* MT4 sutrikimai */
.incident-list { display: grid; gap: 10px; margin: 0 0 12px; padding: 0; list-style: none; }
.incident { padding: 10px 0; border-top: 1px solid var(--line); display: grid; gap: 4px; }
.incident:first-child { border-top: 0; }
.incident__head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }

/* Rolės aprašymas išskleidus (šoninė juosta) */
.navgroup__does { margin: 2px 8px 6px 34px; color: var(--ink-muted); font-size: 12px; line-height: 1.45; }
.navgroup__code { font-variant-numeric: tabular-nums; opacity: .8; }

/* Kliento skydelis (client.js): tos pačios dalys, keli papildymai. */
.banner--warn { border-color: color-mix(in srgb, var(--warn, #b45309) 40%, var(--line)); background: color-mix(in srgb, var(--warn, #b45309) 10%, var(--bg)); }
.banner--danger { border-color: color-mix(in srgb, var(--error) 40%, var(--line)); background: var(--error-soft); color: var(--error); }
#bar.banner { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin-bottom: 16px; }
#bar[hidden] { display: none; }
.grid--2 { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.grid--cards { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.grid--cards .card { display: flex; flex-direction: column; gap: 6px; }
.grid--cards .card h3 { margin: 0; font-size: 16px; text-transform: none; letter-spacing: 0; color: var(--ink); }
.grid--cards .card .tag { align-self: flex-start; }
.field textarea.short { min-height: 80px; }
.seg--lang .seg__btn { padding: 2px 8px; font-size: 12px; }
.topbar__who { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 240px; }
@media (max-width: 640px) { .topbar__who { display: none; } }
.table tr.is-selected td { background: color-mix(in srgb, var(--signal-text) 8%, transparent); }
.split--clients { grid-template-columns: minmax(320px, 2fr) minmax(0, 3fr); }
@media (max-width: 1000px) { .split--clients { grid-template-columns: 1fr; } }

/* Kliento skydelis: „Atlikta“ šalia būsenos */
.list__actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 6px; }
.cell-stack { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }

/* Kliento skydelis: įmonių ir pasiūlymų sąrašas (pasirenkama eilutė, detalės dešinėje) */
.picklist { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.picklist__item { gap: 4px; }
.picklist__top { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.picklist__name { min-width: 0; font-weight: 600; }
.picklist__num { flex: none; color: var(--ink-muted); font-variant-numeric: tabular-nums; font-size: 13px; white-space: nowrap; }
.picklist__foot { display: flex; align-items: center; gap: 8px; min-width: 0; }
.picklist__foot .tag { flex: none; }
.picklist__clip { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }



/* ── Kliento skydelis: darbo kortelė ─────────────────────────────────────── */
.drawer--wide { width: min(600px, 100vw); }
.drawer-backdrop { position: fixed; inset: 0; z-index: 39; background: rgb(0 0 0 / 0.28); }
.drawer-backdrop[hidden] { display: none; }
body.drawer-open { overflow: hidden; }
.row-link { cursor: pointer; }
tr.row-link:hover td { background: var(--surface); }
.linklike { padding: 0; border: 0; background: none; color: inherit; font: inherit; font-weight: 500; text-align: left; cursor: pointer; }
.linklike:hover, .linklike:focus-visible { color: var(--signal-text); text-decoration: underline; text-underline-offset: 2px; }
.drawer__block { margin-top: 24px; }
.drawer__block > h3, .todo > h3 { margin-bottom: 10px; font-size: 14px; }
.drawer__foot { margin-top: 24px; }
.todo { margin-top: 4px; padding: 12px 14px; border: 1px solid var(--wait); border-radius: var(--radius-control); background: var(--wait-soft); }
.todo ul { margin: 0 0 12px; padding-left: 18px; font-size: 13.5px; }
.todo--ok { border-color: var(--line); background: var(--surface); color: var(--ink-muted); }
.agentlog { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.agentlog__item { display: grid; grid-template-columns: 92px 1fr; gap: 10px; padding-left: 12px; border-left: 2px solid var(--ok); font-size: 13.5px; }
.agentlog__item--done { border-left-color: var(--ink-subtle); }
.agentlog__time { padding-top: 1px; }
.excerpt { margin: 8px 0; padding: 10px 12px; border-left: 3px solid var(--line); background: var(--surface); font-size: 13px; white-space: pre-wrap; color: var(--ink-muted); }
.attach { margin: 6px 0 8px; padding: 0; list-style: none; }
.attach .warn { color: var(--warn); }
.table--compact td, .table--compact th { padding: 6px 8px; font-size: 12.5px; }
.table td.num { text-align: right; font-variant-numeric: tabular-nums; }
@media (max-width: 640px) { .agentlog__item { grid-template-columns: 1fr; gap: 2px; } }

.row-actions { display: flex; align-items: center; gap: 8px; justify-content: flex-end; white-space: nowrap; }
.quick { display: inline-flex; align-items: center; gap: 4px; }
.item-page .card > .drawer__block:first-child { margin-top: 0; }
.item-page .todo { margin-top: 0; }
a.linklike { text-decoration: none; }
a.linklike:hover, a.linklike:focus-visible { text-decoration: underline; }
@media (max-width: 640px) { .quick__label { display: none; } }
.drawer__block .facts + .table-scroll { margin-top: 14px; }
.banner__close { margin-left: auto; min-width: 30px; padding: 0 8px; font-size: 16px; line-height: 1; }

.pilot__nums { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin: 8px 0 12px; }
.pilot h3 { margin-top: 12px; font-size: 14px; }
