/* ==========================================================
   Turinio vamzdynas: šio prototipo stiliai.
   Admin įrankio karkasas Linear / Notion principu: šoninis meniu,
   sąrašas su peržiūra (Inbox), dokumento tipo turinio langas.
   Spalvos, tarpai, šriftai tik per var(--ds-*) iš ds/styles/tokens.css.
   ========================================================== */
:root {
  /* Išdėstymo matmenys (ne tarpai, todėl ne DS tokenai) */
  --tv-side-w: 248px;
  --tv-list-w: 420px;
  --tv-panel-w: 360px;
  --tv-doc-w: 760px;
  --tv-top-h: 52px;

  --tv-di: var(--ds-purple-600);          /* DI akcentas, kaip AI paieškoje */
  --tv-di-bg: var(--ds-purple-100);
  --tv-row-sel: var(--ds-teal-100);
  --tv-overlay: rgba(39, 47, 48, .4);     /* nėra DS, siūlyti į shared: modalo užsklanda (grey-900, 40 %) */
  --tv-backdrop: rgba(40, 75, 77, .45);   /* nėra DS, siūlyti į shared: spalvota šoninio skydelio užsklanda (teal-900, 45 %) */
}

body { background: var(--ds-bg-shell); font-size: var(--ds-text-sm-size); line-height: var(--ds-text-sm-lh); }
button { font: inherit; }

/* ---------- Karkasas ---------- */
.tv-app { display: grid; grid-template-columns: var(--tv-side-w) minmax(0, 1fr); height: 100vh; height: 100dvh; overflow: hidden; }
.tv-main { min-width: 0; height: 100%; overflow: auto; background: var(--ds-white); }

.tv-side { display: flex; flex-direction: column; gap: var(--ds-space-xl); height: 100%; overflow-y: auto; padding: var(--ds-space-xl) var(--ds-space-lg); border-right: 1px solid var(--ds-border); background: var(--ds-grey-100); scrollbar-width: thin; }
.tv-brand { display: flex; align-items: flex-end; gap: var(--ds-space-md); padding: var(--ds-space-xs) var(--ds-space-md); }
.tv-brand img { filter: brightness(0); opacity: .75; } /* logotipas baltas, admin'e tamsinam */
.tv-brand-tag { padding: var(--ds-space-xxs) var(--ds-space-md); border-radius: var(--ds-radius-xs); background: var(--ds-teal-200); color: var(--ds-teal-800); font-size: var(--ds-caption-size); line-height: var(--ds-caption-lh); font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }

.tv-find { display: flex; align-items: center; gap: var(--ds-space-md); height: 32px; padding: 0 var(--ds-space-md); border: 1px solid var(--ds-border); border-radius: var(--ds-radius-sm); background: var(--ds-white); color: var(--ds-text-muted); }
.tv-find:focus-within { border-color: var(--ds-teal-500); box-shadow: var(--ds-focus-ring); }
.tv-find input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; font-size: var(--ds-text-sm-size); }

.tv-nav { display: flex; flex-direction: column; gap: 1px; }
.tv-nav-title { margin: 0 0 var(--ds-space-xs); padding: 0 var(--ds-space-md); color: var(--ds-text-muted); font-size: var(--ds-caption-size); line-height: var(--ds-caption-lh); font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.tv-nav-link { display: flex; align-items: center; gap: var(--ds-space-md); min-height: 30px; padding: 0 var(--ds-space-md); border-radius: var(--ds-radius-sm); color: var(--ds-grey-800); text-decoration: none; transition: background var(--ds-duration-fast) ease; }
.tv-nav-link:hover { background: var(--ds-grey-200); color: var(--ds-grey-900); }
.tv-nav-link.is-active { background: var(--ds-white); color: var(--ds-grey-900); font-weight: 600; box-shadow: var(--ds-shadow-sm); }
.tv-nav-ic { display: grid; place-items: center; width: 16px; color: var(--ds-grey-600); }
.tv-nav-ic:empty { display: none; }
.tv-nav-count { margin-left: auto; color: var(--ds-text-muted); font-size: var(--ds-text-xs-size); }
.tv-nav-count.is-strong { padding: 0 var(--ds-space-sm); border-radius: var(--ds-radius-full); background: var(--ds-teal-500); color: var(--ds-white); font-weight: 700; }
.tv-nav-count.is-new { padding: 0 var(--ds-space-sm); border-radius: var(--ds-radius-full); background: var(--ds-salmon-100); color: var(--ds-salmon-700); font-weight: 700; }

/* Prototipo nustatymai: aiškiai atskirti nuo produkto */
.tv-proto { margin-top: auto; padding: var(--ds-space-md); border: 1px dashed var(--ds-grey-400); border-radius: var(--ds-radius-md); background: var(--ds-white); }
.tv-proto-head { display: flex; align-items: center; justify-content: space-between; width: 100%; padding: 0; border: 0; background: none; color: var(--ds-grey-600); font-size: var(--ds-caption-size); font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.tv-proto-chev, .tv-orig-chev { display: grid; transition: transform var(--ds-duration) var(--ds-ease); }
.tv-proto-chev.is-open, .tv-orig-chev.is-open { transform: rotate(180deg); }
.tv-proto-label { margin: var(--ds-space-lg) 0 var(--ds-space-xs); color: var(--ds-text-muted); font-size: var(--ds-text-xs-size); }

.tv-me { display: flex; align-items: center; gap: var(--ds-space-md); padding: var(--ds-space-xs) var(--ds-space-md); }
.tv-me b, .tv-me small { display: block; }
.tv-me small { color: var(--ds-text-muted); font-size: var(--ds-text-xs-size); }

/* ---------- Bendri elementai ---------- */
.tv-h { font-size: var(--ds-h4-size); line-height: var(--ds-h4-lh); }
.tv-muted { color: var(--ds-text-muted); }
.tv-id { color: var(--ds-text-muted); font-family: var(--ds-font-mono); font-size: var(--ds-text-xs-size); }

/* Būsenų spalvos: taškas ir žyma */
.tv-sdot { display: inline-block; flex: 0 0 auto; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.t-grey   { color: var(--ds-grey-500); }
.t-orange { color: var(--ds-orange-600); }
.t-red    { color: var(--ds-red-500); }
.t-blue   { color: var(--ds-blue-600); }
.t-green  { color: var(--ds-green-600); }
.t-teal   { color: var(--ds-teal-600); }
.t-done   { color: var(--ds-grey-400); }
.t-purple { color: var(--ds-purple-600); }

.tv-pill { display: inline-flex; align-items: center; gap: var(--ds-space-sm); padding: 0 var(--ds-space-md); border: 1px solid var(--ds-border); border-radius: var(--ds-radius-full); background: var(--ds-white); font-size: var(--ds-text-xs-size); line-height: 20px; font-weight: 600; white-space: nowrap; }
.tv-pill > span:last-child { color: var(--ds-grey-800); }
.tv-type { padding: 0 var(--ds-space-sm); border-radius: var(--ds-radius-xs); background: var(--ds-blue-100); color: var(--ds-blue-700); font-size: var(--ds-text-xs-size); line-height: 20px; font-weight: 600; white-space: nowrap; }
.tv-prio { display: inline-grid; color: var(--ds-salmon-600); }
.tv-prio-tag { display: inline-flex; align-items: center; gap: var(--ds-space-xs); padding: 0 var(--ds-space-sm); border-radius: var(--ds-radius-xs); background: var(--ds-salmon-100); color: var(--ds-salmon-700); font-size: var(--ds-text-xs-size); line-height: 20px; font-weight: 700; }
.tv-plan { padding: 0 var(--ds-space-xs); border-radius: var(--ds-radius-xs); background: var(--ds-purple-100); color: var(--ds-purple-700); font-size: var(--ds-caption-size); font-weight: 700; }
.tv-age { color: var(--ds-text-muted); font-size: var(--ds-text-xs-size); white-space: nowrap; }
.tv-age.is-warn { color: var(--ds-orange-700); font-weight: 600; }
.tv-age.is-late { color: var(--ds-red-600); font-weight: 700; }

/* Avatarai */
.tv-av { display: inline-grid; place-items: center; flex: 0 0 auto; width: 28px; height: 28px; border-radius: 50%; background: var(--ds-grey-500); color: var(--ds-white); font-size: var(--ds-text-xs-size); font-weight: 700; }
.tv-av.t-teal { background: var(--ds-teal-500); color: var(--ds-white); } .tv-av.t-purple { background: var(--ds-purple-500); color: var(--ds-white); }
.tv-av.t-orange { background: var(--ds-orange-500); color: var(--ds-white); } .tv-av.t-blue { background: var(--ds-blue-500); color: var(--ds-white); }
.tv-av.t-green { background: var(--ds-green-500); color: var(--ds-white); }
.tv-av.is-sm { width: 24px; height: 24px; font-size: var(--ds-caption-size); }
.tv-av.is-xs { width: 18px; height: 18px; font-size: 10px; }
.tv-av.is-empty { border: 1px dashed var(--ds-grey-400); background: transparent; color: var(--ds-grey-500); }

/* Segmentuotas jungiklis */
.tv-seg { display: flex; gap: var(--ds-space-xxs); padding: var(--ds-space-xxs); border-radius: var(--ds-radius-sm); background: var(--ds-grey-100); }
.tv-seg button { display: inline-flex; flex: 1; align-items: center; justify-content: center; gap: var(--ds-space-xs); min-height: 28px; padding: 0 var(--ds-space-md); border: 0; border-radius: var(--ds-radius-xs); background: none; color: var(--ds-grey-700); font-size: var(--ds-text-xs-size); font-weight: 600; transition: background var(--ds-duration-fast) ease; }
.tv-seg button:hover { color: var(--ds-grey-900); }
.tv-seg button.is-on { background: var(--ds-white); color: var(--ds-grey-900); box-shadow: var(--ds-shadow-sm); }
.tv-seg.is-col { flex-direction: column; }
.tv-seg.is-col button { justify-content: flex-start; padding: var(--ds-space-xs) var(--ds-space-md); }
.tv-seg.is-col small { margin-left: auto; color: var(--ds-text-muted); font-weight: 400; font-size: var(--ds-caption-size); }
.tv-seg.is-sm { display: inline-flex; }

/* Žetonai */
.tv-chips { display: flex; flex-wrap: wrap; align-items: center; gap: var(--ds-space-sm); }
.tv-chip { display: inline-flex; align-items: center; gap: var(--ds-space-sm); min-height: 28px; padding: 0 var(--ds-space-lg) 0 var(--ds-space-sm); border: 1px solid var(--ds-border-strong); border-radius: var(--ds-radius-full); background: var(--ds-white); color: var(--ds-grey-800); font-size: var(--ds-text-xs-size); font-weight: 600; transition: background var(--ds-duration-fast) ease, border-color var(--ds-duration-fast) ease; }
.tv-chip:hover { border-color: var(--ds-teal-400); background: var(--ds-teal-100); }
.tv-chip.is-on { border-color: var(--ds-teal-500); background: var(--ds-teal-100); box-shadow: inset 0 0 0 1px var(--ds-teal-500); }
.tv-chip small { color: var(--ds-text-muted); font-weight: 400; }
.tv-chip.is-di { padding: var(--ds-space-xs) var(--ds-space-lg); border-color: var(--ds-purple-200); background: var(--ds-white); color: var(--tv-di); text-align: left; }
.tv-chip.is-di:hover { background: var(--tv-di-bg); }

.tv-icon-btn { display: inline-grid; place-items: center; width: 32px; height: 32px; padding: 0; border: 0; border-radius: var(--ds-radius-sm); background: none; color: var(--ds-grey-600); transition: background var(--ds-duration-fast) ease; }
.tv-icon-btn:hover, .tv-icon-btn.is-on { background: var(--ds-grey-100); color: var(--ds-grey-900); }
.tv-icon-btn.is-sm { width: 24px; height: 24px; }
.tv-row-actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--ds-space-md); margin: 0; }
kbd { display: inline-block; min-width: 18px; padding: 0 var(--ds-space-xs); border: 1px solid var(--ds-border-strong); border-bottom-width: 2px; border-radius: var(--ds-radius-xs); background: var(--ds-white); font-family: var(--ds-font-family); font-size: var(--ds-caption-size); text-align: center; }

.tv-empty { display: grid; place-items: center; gap: var(--ds-space-md); padding: var(--ds-space-6xl) var(--ds-space-3xl); color: var(--ds-text-muted); text-align: center; }

/* ---------- Sąrašas + peržiūra ---------- */
.tv-inbox { display: grid; grid-template-columns: var(--tv-list-w) minmax(0, 1fr); height: 100%; }
.tv-list { display: flex; flex-direction: column; min-height: 0; border-right: 1px solid var(--ds-border); }
.tv-list-head { display: flex; align-items: baseline; gap: var(--ds-space-md); height: var(--tv-top-h); padding: var(--ds-space-lg) var(--ds-space-2xl); border-bottom: 1px solid var(--ds-border); }
.tv-list-scroll { flex: 1; overflow-y: auto; }
.tv-group { display: flex; align-items: center; gap: var(--ds-space-md); margin: 0; padding: var(--ds-space-md) var(--ds-space-2xl); border-bottom: 1px solid var(--ds-border); background: var(--ds-grey-100); font-size: var(--ds-text-xs-size); font-weight: 700; color: var(--ds-grey-700); }
.tv-row { display: flex; flex-direction: column; gap: var(--ds-space-xs); width: 100%; padding: var(--ds-space-lg) var(--ds-space-2xl); border: 0; border-bottom: 1px solid var(--ds-border); border-left: 3px solid transparent; background: var(--ds-white); text-align: left; transition: background var(--ds-duration-fast) ease; }
.tv-row:hover { background: var(--ds-grey-100); }
.tv-row.is-sel { border-left-color: var(--ds-teal-500); background: var(--tv-row-sel); }
.tv-row-top, .tv-row-meta { display: flex; align-items: center; gap: var(--ds-space-md); min-width: 0; }
.tv-row-client { flex: 1; min-width: 0; overflow: hidden; color: var(--ds-text-muted); font-size: var(--ds-text-xs-size); text-overflow: ellipsis; white-space: nowrap; }
.tv-row-title { display: -webkit-box; overflow: hidden; color: var(--ds-grey-900); font-size: var(--ds-text-sm-size); line-height: var(--ds-text-sm-lh); font-weight: 600; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.tv-row-title.is-raw { font-weight: 400; color: var(--ds-grey-800); }
.tv-row-meta .tv-av { margin-left: auto; }
.tv-note-ind { padding: 0 var(--ds-space-sm); border-radius: var(--ds-radius-xs); background: var(--ds-orange-100); color: var(--ds-orange-800); font-size: var(--ds-caption-size); line-height: 18px; font-weight: 700; }
.tv-ver-ind { color: var(--ds-text-muted); font-family: var(--ds-font-mono); font-size: var(--ds-caption-size); }
.tv-keys { display: flex; align-items: center; gap: var(--ds-space-xs); margin: 0; padding: var(--ds-space-md) var(--ds-space-2xl); border-top: 1px solid var(--ds-border); color: var(--ds-text-muted); font-size: var(--ds-text-xs-size); }

.tv-preview { min-width: 0; height: 100%; }
.tv-preview-in { display: flex; flex-direction: column; height: 100%; }
.tv-preview-scroll { flex: 1; overflow-y: auto; padding: var(--ds-space-3xl) var(--ds-space-4xl); }
.tv-preview-scroll > * + * { margin-top: var(--ds-space-xl); }
.tv-preview-scroll, .tv-preview-foot { max-width: calc(var(--tv-doc-w) + 2 * var(--ds-space-4xl)); }
.tv-crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: var(--ds-space-md); margin: 0; }
.tv-crumbs a { color: var(--ds-text-muted); text-decoration: none; }
.tv-crumbs a:hover { color: var(--ds-grey-900); }
.tv-preview-title { font-size: var(--ds-h2-size); line-height: var(--ds-h2-lh); }
.tv-preview-title.is-raw { color: var(--ds-text-faint); font-weight: 600; }
.tv-preview-foot { display: flex; flex-direction: column; gap: var(--ds-space-lg); padding: var(--ds-space-xl) var(--ds-space-4xl); border-top: 1px solid var(--ds-border); background: var(--ds-white); }
.tv-quick-assign { display: flex; flex-direction: column; gap: var(--ds-space-md); padding-bottom: var(--ds-space-lg); border-bottom: 1px solid var(--ds-border); }
.tv-ver-sum { font-size: var(--ds-text-xs-size); }

/* Pastaba: svarbu matosi iškart, ne pasimeta tekste */
.tv-note, .tv-callout { padding: var(--ds-space-lg) var(--ds-space-xl); border-radius: var(--ds-radius-md); background: var(--ds-grey-100); }
.tv-note > p + p, .tv-callout > p + p { margin-top: var(--ds-space-xs); }
.tv-note.is-important { border-left: 3px solid var(--ds-orange-500); background: var(--ds-orange-100); color: var(--ds-orange-900); }
.tv-note-head { display: flex; align-items: center; gap: var(--ds-space-sm); font-size: var(--ds-text-xs-size); }
.tv-callout.is-return { border-left: 3px solid var(--ds-red-400); background: var(--ds-red-100); color: var(--ds-red-900); }
.tv-callout.is-return .btn-ds--link { margin-top: var(--ds-space-sm); font-size: var(--ds-text-xs-size); }
.tv-callout.is-lock { display: flex; align-items: center; gap: var(--ds-space-md); background: var(--ds-blue-100); color: var(--ds-blue-800); }

/* Originalas: užrakintas */
.tv-orig { border: 1px solid var(--ds-border); border-radius: var(--ds-radius-md); background: var(--ds-grey-100); }
.tv-orig-head { display: flex; align-items: center; gap: var(--ds-space-sm); width: 100%; margin: 0; padding: var(--ds-space-md) var(--ds-space-xl); border: 0; background: none; color: var(--ds-grey-700); font-size: var(--ds-text-xs-size); font-weight: 700; text-align: left; }
.tv-orig-head .tv-muted { margin-left: auto; font-weight: 400; }
.tv-orig-text { padding: 0 var(--ds-space-xl) var(--ds-space-lg); color: var(--ds-grey-800); font-size: var(--ds-text-sm-size); line-height: 1.6; white-space: pre-line; }
.tv-orig-foot { display: flex; align-items: center; justify-content: flex-end; gap: var(--ds-space-md); padding: var(--ds-space-sm) var(--ds-space-md) var(--ds-space-sm) var(--ds-space-xl); border-top: 1px solid var(--ds-border); font-size: var(--ds-text-xs-size); }

/* ---------- Turinio kūrimo langas ---------- */
.tv-editor { display: flex; flex-direction: column; height: 100%; }
.tv-ed-top { display: flex; align-items: center; gap: var(--ds-space-md); min-height: var(--tv-top-h); padding: var(--ds-space-md) var(--ds-space-xl); border-bottom: 1px solid var(--ds-border); background: var(--ds-white); }
.tv-ed-tools { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: var(--ds-space-md); margin-left: auto; }
.tv-people { display: flex; margin-right: var(--ds-space-xs); }
.tv-people .tv-av { box-shadow: 0 0 0 2px var(--ds-white); }
.tv-people .tv-av + .tv-av { margin-left: calc(-1 * var(--ds-space-sm)); }
.tv-tool { display: inline-flex; align-items: center; gap: var(--ds-space-sm); height: 32px; padding: 0 var(--ds-space-md); border: 1px solid var(--ds-border); border-radius: var(--ds-radius-sm); background: var(--ds-white); color: var(--ds-grey-700); font-size: var(--ds-text-xs-size); font-weight: 600; }
.tv-tool:hover, .tv-tool.is-on { background: var(--ds-grey-100); color: var(--ds-grey-900); }

.tv-ed-grid { display: grid; grid-template-columns: minmax(0, 1fr); flex: 1; min-height: 0; }
.tv-editor.has-panel .tv-ed-grid { grid-template-columns: minmax(0, 1fr) var(--tv-panel-w); }

.tv-doc { position: relative; overflow-y: auto; padding: var(--ds-space-4xl) var(--ds-space-5xl) var(--ds-space-6xl); }
.tv-doc > * { max-width: var(--tv-doc-w); margin-inline: auto; }
.tv-doc > * + * { margin-top: var(--ds-space-2xl); }

.tv-field { position: relative; display: flex; flex-direction: column; gap: var(--ds-space-sm); }
.tv-field-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--ds-space-md); }
.tv-field-head .tv-muted { font-size: var(--ds-text-xs-size); }
.tv-label { color: var(--ds-grey-700); font-size: var(--ds-text-xs-size); font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }

.tv-title-field { flex-direction: row; align-items: flex-start; gap: var(--ds-space-md); padding-top: var(--ds-space-md); }
.tv-title-input { flex: 1; min-width: 0; padding: 0; border: 0; outline: 0; resize: none; background: none; color: var(--ds-text-title); font-size: var(--ds-h1-size); line-height: var(--ds-h1-lh); font-weight: 700; field-sizing: content; }
.tv-title-input::placeholder { color: var(--ds-grey-300); }

.tv-textarea { width: 100%; padding: var(--ds-space-md) var(--ds-space-lg); border: 1px solid var(--ds-border-strong); border-radius: var(--ds-radius-sm); resize: vertical; background: var(--ds-white); font-size: var(--ds-text-intro-size); line-height: var(--ds-text-intro-lh); field-sizing: content; min-height: 64px; transition: border-color var(--ds-duration-fast) ease, box-shadow var(--ds-duration-fast) ease; }
.tv-textarea:focus { outline: 0; border-color: var(--ds-teal-600); box-shadow: var(--ds-focus-ring); }
.tv-textarea[readonly], .tv-title-input[readonly] { cursor: default; }
.tv-textarea[readonly] { background: var(--ds-grey-100); }

/* DI mygtukai ir blokai */
@keyframes tv-pulse { 50% { opacity: .3; transform: scale(.8); } }

.tv-menu { position: absolute; top: 100%; right: 0; z-index: 20; width: min(520px, 100%); margin-top: var(--ds-space-xs); padding: var(--ds-space-sm); border: 1px solid var(--ds-border); border-radius: var(--ds-radius-lg); background: var(--ds-white); box-shadow: var(--ds-shadow-lg); }
.tv-menu-head { display: flex; align-items: center; gap: var(--ds-space-sm); padding: var(--ds-space-sm) var(--ds-space-md); color: var(--tv-di); font-size: var(--ds-text-xs-size); font-weight: 600; }
.tv-menu-item { display: block; width: 100%; padding: var(--ds-space-md); border: 0; border-radius: var(--ds-radius-sm); background: none; color: var(--ds-grey-900); font-size: var(--ds-text-sm-size); font-weight: 600; text-align: left; }
.tv-menu-item:hover { background: var(--tv-di-bg); }

.tv-di-card { padding: var(--ds-space-lg) var(--ds-space-xl); border: 1px solid var(--ds-border); border-radius: var(--ds-radius-lg); background: var(--ds-white); }
.tv-di-card header { display: flex; align-items: center; gap: var(--ds-space-md); font-size: var(--ds-text-xs-size); }
.tv-di-card header img { width: 10px; height: auto; }
.tv-di-card header .tv-icon-btn { margin-left: auto; }
.tv-di-sum { margin: var(--ds-space-md) 0 var(--ds-space-lg); padding-left: var(--ds-space-2xl); font-size: var(--ds-text-sm-size); line-height: 1.6; }
.tv-di-sum li + li { margin-top: var(--ds-space-xs); }
.tv-di-disc { font-size: var(--ds-caption-size); }
.tv-cite { display: inline-grid; place-items: center; min-width: 16px; height: 16px; padding: 0 var(--ds-space-xs); border-radius: var(--ds-radius-xs); background: var(--ds-purple-200); color: var(--ds-purple-800); font-size: 10px; font-weight: 700; line-height: 1; vertical-align: 1px; cursor: help; }

/* Teksto redaktorius */
.tv-toolbar { position: sticky; top: calc(-1 * var(--ds-space-4xl)); z-index: 5; display: flex; flex-wrap: wrap; align-items: center; gap: var(--ds-space-xxs); padding: var(--ds-space-xs); border: 1px solid var(--ds-border-strong); border-bottom: 0; border-radius: var(--ds-radius-sm) var(--ds-radius-sm) 0 0; background: var(--ds-grey-100); }
.tv-toolbar button { display: inline-flex; align-items: center; gap: var(--ds-space-xs); height: 28px; min-width: 28px; justify-content: center; padding: 0 var(--ds-space-sm); border: 0; border-radius: var(--ds-radius-xs); background: none; color: var(--ds-grey-700); font-size: var(--ds-text-xs-size); font-weight: 600; }
.tv-toolbar button:hover, .tv-toolbar button.is-on { background: var(--ds-white); color: var(--ds-grey-900); box-shadow: var(--ds-shadow-sm); }
.tv-toolbar button.is-text { padding: 0 var(--ds-space-md); }
.tv-toolbar button.is-di { color: var(--tv-di); }
.tv-toolbar-sep { width: 1px; height: 18px; margin: 0 var(--ds-space-xs); background: var(--ds-border-strong); }
.tv-body { min-height: 280px; padding: var(--ds-space-xl) var(--ds-space-2xl); border: 1px solid var(--ds-border-strong); border-radius: 0 0 var(--ds-radius-sm) var(--ds-radius-sm); outline: 0; font-size: var(--ds-text-intro-size); line-height: 1.65; transition: border-color var(--ds-duration-fast) ease, box-shadow var(--ds-duration-fast) ease; }
.tv-body:focus { border-color: var(--ds-teal-600); box-shadow: var(--ds-focus-ring); }
.tv-body[contenteditable="false"] { border-radius: var(--ds-radius-sm); background: var(--ds-grey-100); }
.tv-body:empty::before { content: attr(data-placeholder); color: var(--ds-text-faint); }
.tv-body p, .tv-version-body p { margin: 0 0 var(--ds-space-lg); }
.tv-body h3, .tv-version-body h3 { margin: var(--ds-space-2xl) 0 var(--ds-space-sm); font-size: var(--ds-h4-size); line-height: var(--ds-h4-lh); }
.tv-body ul { margin: 0 0 var(--ds-space-lg); padding-left: var(--ds-space-2xl); }

/* Rašyba */
mark.tv-sp { background: none; color: inherit; text-decoration: underline wavy var(--ds-red-500); text-decoration-thickness: 1.5px; text-underline-offset: 3px; cursor: pointer; }
mark.tv-sp:hover { background: var(--ds-red-100); }
.tv-spell-state { display: inline-flex; align-items: center; gap: var(--ds-space-md); margin-left: auto; color: var(--ds-red-700); font-size: var(--ds-text-xs-size); font-weight: 600; }
.tv-spell-state .btn-ds--link { font-size: var(--ds-text-xs-size); }
.tv-sp-pop { position: absolute; z-index: 25; display: flex; align-items: center; gap: var(--ds-space-md); margin: 0; padding: var(--ds-space-sm) var(--ds-space-md); border: 1px solid var(--ds-border); border-radius: var(--ds-radius-md); background: var(--ds-white); box-shadow: var(--ds-shadow-md); font-size: var(--ds-text-xs-size); }
.tv-doc > .tv-field .tv-sp-pop { max-width: none; }
.tv-sp-fix { padding: var(--ds-space-xxs) var(--ds-space-md); border: 0; border-radius: var(--ds-radius-xs); background: var(--ds-green-100); color: var(--ds-green-800); font-weight: 700; }
.tv-sp-fix:hover { background: var(--ds-green-200); }
.tv-sp-pop .btn-ds--link { font-size: var(--ds-text-xs-size); }

/* Žymos */
.tv-tag { display: inline-flex; align-items: center; gap: var(--ds-space-xs); min-height: 26px; padding: 0 var(--ds-space-md); border-radius: var(--ds-radius-sm); background: var(--ds-teal-100); color: var(--ds-teal-800); font-size: var(--ds-text-xs-size); font-weight: 600; }
.tv-tag button { display: inline-flex; align-items: center; gap: var(--ds-space-xs); padding: 0; border: 0; background: none; color: inherit; font-weight: inherit; }
.tv-tag > button:last-child { opacity: .6; }
.tv-tag > button:last-child:hover { opacity: 1; }
.tv-tag.is-suggest { border: 1px dashed var(--ds-purple-300); background: var(--ds-white); color: var(--tv-di); }
.tv-tag.is-suggest:hover { background: var(--tv-di-bg); }
.tv-tag.is-src { background: var(--ds-grey-100); color: var(--ds-grey-800); }
.tv-suggest-label { display: inline-flex; align-items: center; gap: var(--ds-space-xs); color: var(--tv-di); font-size: var(--ds-text-xs-size); font-weight: 600; }

/* ---------- Šoninis skydelis ---------- */
.tv-panel { display: flex; flex-direction: column; min-height: 0; border-left: 1px solid var(--ds-border); background: var(--ds-white); }
.tv-tabs { display: flex; gap: var(--ds-space-xxs); padding: 0 var(--ds-space-md); border-bottom: 1px solid var(--ds-border); overflow-x: auto; scrollbar-width: none; }
.tv-tabs button { position: relative; display: inline-flex; align-items: center; gap: var(--ds-space-xs); height: 42px; padding: 0 var(--ds-space-md); border: 0; background: none; color: var(--ds-grey-600); font-size: var(--ds-text-xs-size); font-weight: 600; white-space: nowrap; }
.tv-tabs button:hover { color: var(--ds-grey-900); }
.tv-tabs button.is-on { color: var(--ds-grey-900); box-shadow: inset 0 -2px 0 var(--ds-teal-500); }
.tv-tabs button:first-child.is-on span:first-child { color: var(--tv-di); }
.tv-tab-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--ds-salmon-500); }
.tv-tab-n { padding: 0 var(--ds-space-xs); border-radius: var(--ds-radius-full); background: var(--ds-grey-200); font-size: var(--ds-caption-size); }

.tv-pane { flex: 1; overflow-y: auto; padding: var(--ds-space-xl); }
.tv-pane > * + * { margin-top: var(--ds-space-lg); }
.tv-pane-intro { color: var(--ds-text-muted); font-size: var(--ds-text-xs-size); }
.tv-sim { padding: var(--ds-space-lg); border: 1px solid var(--ds-border); border-radius: var(--ds-radius-md); }
.tv-sim-top { display: flex; align-items: center; gap: var(--ds-space-md); font-size: var(--ds-text-xs-size); }
.tv-sim-title { margin: var(--ds-space-xs) 0 var(--ds-space-sm); font-weight: 600; color: var(--ds-grey-900); }
.tv-sim .btn-ds--link { font-size: var(--ds-text-xs-size); }
.tv-match { margin-left: auto; padding: 0 var(--ds-space-sm); border-radius: var(--ds-radius-xs); background: var(--ds-green-100); color: var(--ds-green-800); font-weight: 700; }
.tv-src-tag { padding: 0 var(--ds-space-sm); border-radius: var(--ds-radius-xs); background: var(--ds-grey-200); color: var(--ds-grey-800); font-size: var(--ds-caption-size); line-height: 18px; font-weight: 700; }
.tv-new { margin-left: auto; padding: 0 var(--ds-space-sm); border-radius: var(--ds-radius-xs); background: var(--ds-salmon-100); color: var(--ds-salmon-700); font-size: var(--ds-caption-size); line-height: 18px; font-weight: 700; }

/* DI pokalbis */
.tv-chat { display: flex; flex: 1; flex-direction: column; min-height: 0; }
.tv-chat-ctx { display: flex; flex-wrap: wrap; align-items: center; gap: var(--ds-space-sm); margin: 0; padding: var(--ds-space-md) var(--ds-space-xl); border-bottom: 1px solid var(--ds-border); font-size: var(--ds-text-xs-size); }
.tv-ctx-chip { display: inline-flex; align-items: center; gap: var(--ds-space-xs); padding: 0 var(--ds-space-md); border-radius: var(--ds-radius-full); background: var(--ds-teal-100); color: var(--ds-teal-800); font-weight: 600; line-height: 22px; }
.tv-chat-log { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: var(--ds-space-lg); padding: var(--ds-space-xl); }
.tv-msg { max-width: 92%; font-size: var(--ds-text-sm-size); line-height: 1.55; }
.tv-msg > * + * { margin-top: var(--ds-space-md); }
.tv-msg.is-me { align-self: flex-end; padding: var(--ds-space-md) var(--ds-space-lg); border-radius: var(--ds-radius-lg) var(--ds-radius-lg) var(--ds-radius-xs) var(--ds-radius-lg); background: var(--ds-teal-100); }
.tv-msg.is-ai { align-self: flex-start; }
.tv-msg-src { list-style: none; margin: var(--ds-space-md) 0 0; padding: 0; }
.tv-msg-src li { display: flex; align-items: flex-start; gap: var(--ds-space-md); padding: var(--ds-space-md); border: 1px solid var(--ds-border); border-radius: var(--ds-radius-md); font-size: var(--ds-text-xs-size); line-height: var(--ds-text-xs-lh); }
.tv-msg-src li + li { margin-top: var(--ds-space-sm); }
.tv-msg-src li > span:nth-child(2) { flex: 1; }
.tv-msg-src small, .tv-msg-src b, .tv-msg-src q { display: block; }
.tv-msg-src small { color: var(--ds-teal-700); font-weight: 700; }
.tv-msg-src small.is-ext { color: var(--ds-blue-700); }
.tv-msg-src q { margin-top: var(--ds-space-xs); color: var(--ds-text-muted); }
.tv-msg.is-typing { display: flex; gap: var(--ds-space-xs); padding: var(--ds-space-md) 0; }
.tv-msg.is-typing span { width: 6px; height: 6px; border-radius: 50%; background: var(--ds-purple-400); animation: tv-pulse 1s infinite; }
.tv-msg.is-typing span:nth-child(2) { animation-delay: .15s; }
.tv-msg.is-typing span:nth-child(3) { animation-delay: .3s; }
.tv-chat-in { display: flex; align-items: center; gap: var(--ds-space-xs); margin: 0 var(--ds-space-xl); padding: var(--ds-space-xs) var(--ds-space-xs) var(--ds-space-xs) var(--ds-space-lg); border: 1px solid var(--ds-border-strong); border-radius: var(--ds-radius-lg); }
.tv-chat-in:focus-within { border-color: var(--ds-teal-500); box-shadow: var(--ds-focus-ring); }
.tv-chat-in input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; font-size: var(--ds-text-sm-size); }
.tv-pane .tv-chat-in { margin: var(--ds-space-xl) 0 0; }
.tv-chat-disc { margin: var(--ds-space-sm) var(--ds-space-xl) var(--ds-space-lg); color: var(--ds-text-faint); font-size: var(--ds-caption-size); }

/* Versijų laiko juosta */
.tv-timeline { list-style: none; margin: 0; padding: 0; }
.tv-timeline li { position: relative; padding: 0 0 var(--ds-space-2xl) var(--ds-space-2xl); }
.tv-timeline li::before { content: ''; position: absolute; left: 4px; top: 12px; bottom: 0; width: 1px; background: var(--ds-border-strong); }
.tv-timeline li:last-child::before { display: none; }
.tv-timeline li > p { margin: 0; }
.tv-timeline li > p + p { margin-top: var(--ds-space-xs); }
.tv-tl-dot { position: absolute; left: 0; top: 6px; width: 9px; height: 9px; border-radius: 50%; background: var(--ds-grey-400); }
.tv-timeline li.is-now .tv-tl-dot { background: var(--ds-white); box-shadow: inset 0 0 0 2px var(--ds-teal-500); }
.tv-timeline li.is-perdavė .tv-tl-dot { background: var(--ds-blue-500); }
.tv-timeline li.is-grąžino .tv-tl-dot { background: var(--ds-red-500); }
.tv-timeline li.is-patvirtino .tv-tl-dot { background: var(--ds-green-500); }
.tv-tl-head { display: flex; flex-wrap: wrap; align-items: center; gap: var(--ds-space-xs); }
.tv-tl-head svg { color: var(--ds-text-muted); }
.tv-tl-comment { padding: var(--ds-space-sm) var(--ds-space-md); border-radius: var(--ds-radius-sm); background: var(--ds-grey-100); font-size: var(--ds-text-xs-size); }
.tv-timeline .btn-ds--link { font-size: var(--ds-text-xs-size); }
.tv-ver { padding: 0 var(--ds-space-sm); border-radius: var(--ds-radius-xs); background: var(--ds-grey-200); color: var(--ds-grey-800); font-family: var(--ds-font-mono); font-size: var(--ds-text-xs-size); font-weight: 700; }

.tv-comment { display: flex; gap: var(--ds-space-md); }
.tv-comment p + p { margin-top: var(--ds-space-xxs); }

/* ---------- Dienos peržiūra, Pokyčio langas (žemas detalumas) ---------- */
.tv-page { padding: var(--ds-space-3xl) var(--ds-space-4xl) var(--ds-space-6xl); }
.tv-page-head { max-width: var(--tv-doc-w); margin-bottom: var(--ds-space-3xl); }
.tv-page-head p { margin-top: var(--ds-space-xs); }
.tv-sched { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: var(--ds-space-3xl); align-items: start; }
.tv-plan-pool { display: flex; flex-direction: column; gap: var(--ds-space-md); padding: var(--ds-space-lg); border: 1px dashed var(--ds-border-strong); border-radius: var(--ds-radius-lg); }
.tv-plan-pool .tv-group { padding: 0; border: 0; background: none; }
.tv-days { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: var(--ds-space-lg); }
.tv-day { display: flex; flex-direction: column; gap: var(--ds-space-sm); padding: var(--ds-space-md); border-radius: var(--ds-radius-lg); background: var(--ds-grey-100); }
.tv-day-head { display: flex; justify-content: space-between; padding: var(--ds-space-xs) var(--ds-space-xs) var(--ds-space-sm); font-size: var(--ds-text-xs-size); }
.tv-card { display: flex; align-items: flex-start; gap: var(--ds-space-md); padding: var(--ds-space-md); border: 1px solid var(--ds-border); border-radius: var(--ds-radius-md); background: var(--ds-white); box-shadow: var(--ds-shadow-sm); cursor: grab; font-size: var(--ds-text-xs-size); line-height: var(--ds-text-xs-lh); }
.tv-plan-pool .tv-card { flex-wrap: wrap; }
.tv-plan-pool .tv-card .btn-ds--link { margin-left: var(--ds-space-xl); font-size: var(--ds-text-xs-size); }
.tv-card-title { flex: 1; min-width: 0; font-weight: 600; color: var(--ds-grey-900); }
.tv-drag { color: var(--ds-text-faint); }
.tv-slot-n { display: grid; place-items: center; flex: 0 0 auto; width: 18px; height: 18px; border-radius: var(--ds-radius-xs); background: var(--ds-teal-100); color: var(--ds-teal-800); font-weight: 700; }
.tv-card-ops { display: flex; flex-direction: column; }
.tv-card-ops button { display: grid; place-items: center; width: 20px; height: 18px; padding: 0; border: 0; border-radius: var(--ds-radius-xs); background: none; color: var(--ds-grey-500); }
.tv-card-ops button:hover:not(:disabled) { background: var(--ds-grey-100); color: var(--ds-grey-900); }
.tv-card-ops button:disabled { opacity: .3; cursor: default; }
.tv-slot-empty { display: grid; place-items: center; min-height: 44px; border: 1px dashed var(--ds-border-strong); border-radius: var(--ds-radius-md); color: var(--ds-text-faint); font-size: var(--ds-text-xs-size); }

.tv-lofi { max-width: 980px; border: 1px solid var(--ds-border); border-radius: var(--ds-radius-lg); }
.tv-lofi-row { display: flex; align-items: center; gap: var(--ds-space-lg); padding: var(--ds-space-lg) var(--ds-space-xl); }
.tv-lofi-row + .tv-lofi-row { border-top: 1px solid var(--ds-border); }

/* ---------- Modalai, pranešimai ---------- */
.tv-scrim { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: var(--ds-space-xl); background: var(--tv-overlay); }
.tv-modal { width: min(480px, 100%); max-height: calc(100dvh - 2 * var(--ds-space-xl)); overflow-y: auto; padding: var(--ds-space-3xl); border-radius: var(--ds-radius-xl); background: var(--ds-white); box-shadow: var(--ds-shadow-lg); }
.tv-modal.is-wide { width: min(760px, 100%); }
.tv-modal > div > * + * { margin-top: var(--ds-space-lg); }
.tv-modal-h { display: flex; align-items: center; gap: var(--ds-space-md); font-size: var(--ds-h4-size); line-height: var(--ds-h4-lh); }
.tv-modal-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--ds-space-md); }
.tv-modal-ver { display: flex; align-items: center; gap: var(--ds-space-sm); padding: var(--ds-space-md) var(--ds-space-lg); border-radius: var(--ds-radius-sm); background: var(--ds-blue-100); color: var(--ds-blue-800); font-size: var(--ds-text-xs-size); }
.tv-modal-foot { display: flex; justify-content: flex-end; gap: var(--ds-space-md); padding-top: var(--ds-space-md); }
.tv-pick { display: flex; flex-direction: column; gap: var(--ds-space-xs); }
.tv-pick button { display: flex; align-items: center; gap: var(--ds-space-lg); padding: var(--ds-space-md) var(--ds-space-lg); border: 1px solid var(--ds-border); border-radius: var(--ds-radius-md); background: var(--ds-white); text-align: left; }
.tv-pick button:hover:not(:disabled) { border-color: var(--ds-teal-400); background: var(--ds-teal-100); }
.tv-pick button.is-on { border-color: var(--ds-teal-500); background: var(--ds-teal-100); box-shadow: inset 0 0 0 1px var(--ds-teal-500); }
.tv-pick button:disabled { opacity: .45; cursor: not-allowed; }
.tv-pick b, .tv-pick small { display: block; }
.tv-pick small { color: var(--ds-text-muted); font-size: var(--ds-text-xs-size); }
.tv-pick.is-days { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }

.tv-version-body { max-height: 52vh; overflow-y: auto; padding: var(--ds-space-xl); border: 1px solid var(--ds-border); border-radius: var(--ds-radius-md); background: var(--ds-grey-100); font-size: var(--ds-text-intro-size); line-height: 1.65; }
.tv-version-body.is-diff { white-space: pre-wrap; }
.tv-version-body del, .tv-diff-legend del { background: var(--ds-red-100); color: var(--ds-red-700); text-decoration: line-through; }
.tv-version-body ins, .tv-diff-legend ins { background: var(--ds-green-100); color: var(--ds-green-800); text-decoration: none; }
.tv-diff-legend { color: var(--ds-text-muted); font-size: var(--ds-text-xs-size); }

.tv-toast { position: fixed; left: 50%; bottom: var(--ds-space-3xl); z-index: 60; display: flex; align-items: center; gap: var(--ds-space-md); max-width: calc(100vw - 2 * var(--ds-space-xl)); padding: var(--ds-space-md) var(--ds-space-xl); border-radius: var(--ds-radius-md); background: var(--ds-grey-900); color: var(--ds-white); box-shadow: var(--ds-shadow-lg); transform: translateX(-50%); }
.tv-toast svg { color: var(--ds-green-400); }

/* ---------- Siauresni ekranai ---------- */
@media (max-width: 1280px) {
  :root { --tv-list-w: 360px; --tv-panel-w: 320px; }
  .tv-doc { padding-inline: var(--ds-space-3xl); }
}
@media (max-width: 1100px) {
  .tv-editor.has-panel .tv-ed-grid { grid-template-columns: minmax(0, 1fr); }
  .tv-editor.has-panel .tv-panel { position: fixed; top: 0; right: 0; bottom: 0; z-index: 40; width: min(var(--tv-panel-w), 100vw); box-shadow: var(--ds-shadow-lg); }
  .tv-sched { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 860px) {
  .tv-app { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); }
  .tv-side { flex-direction: row; flex-wrap: wrap; align-items: center; height: auto; max-height: 40vh; border-right: 0; border-bottom: 1px solid var(--ds-border); }
  .tv-nav, .tv-proto { flex: 1 1 200px; margin-top: 0; }
  .tv-me { display: none; }
  .tv-inbox { grid-template-columns: minmax(0, 1fr); grid-template-rows: 45% 55%; }
  .tv-list { border-right: 0; border-bottom: 1px solid var(--ds-border); }
  .tv-preview-scroll, .tv-preview-foot { padding-inline: var(--ds-space-xl); }
  .tv-doc { padding: var(--ds-space-2xl) var(--ds-space-xl) var(--ds-space-5xl); }
  .tv-page { padding-inline: var(--ds-space-xl); }
  .tv-pick.is-days { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tv-lofi-row { flex-wrap: wrap; }
}

/* ---------- Atsakymo struktūra: D/K įrašai ir publikacijos peržiūra ---------- */
.tv-textarea.is-lead { font-weight: 600; }
.tv-field-link { margin-left: auto; font-size: var(--ds-text-xs-size); }
.tv-dk-ic { padding: 0 var(--ds-space-xs); border-radius: var(--ds-radius-xxs); background: var(--ds-grey-200); font-family: var(--ds-font-mono); font-size: var(--ds-caption-size); }

/* Buhalterinis įrašas: visur tas pats, D ir K su sąskaita ir suma, K atitrauktas */
table.dk { width: auto; min-width: min(100%, 480px); margin: 0 0 var(--ds-space-lg); border-collapse: collapse; border-left: 3px solid var(--ds-teal-300); background: var(--ds-teal-100); font-size: var(--ds-text-sm-size); line-height: var(--ds-text-sm-lh); }
table.dk td { padding: var(--ds-space-xs) var(--ds-space-md); vertical-align: top; }
table.dk tr:first-child td { padding-top: var(--ds-space-md); }
table.dk tr:last-child td { padding-bottom: var(--ds-space-md); }
table.dk .dk-s { width: 1%; color: var(--ds-teal-800); font-weight: 700; }
table.dk tr + tr .dk-s { padding-left: var(--ds-space-3xl); }
table.dk .dk-sum { padding-left: var(--ds-space-3xl); font-weight: 600; text-align: right; white-space: nowrap; }

/* Publikacijos peržiūra: šoninis skydelis virš puslapio, turinys kaip Suflerio praktinės situacijos puslapyje */
.tv-drawer-scrim { position: fixed; inset: 0; z-index: 55; background: var(--tv-backdrop); }
.tv-drawer { position: fixed; top: 0; right: 0; bottom: 0; z-index: 56; display: flex; flex-direction: column; width: min(820px, 100vw); overflow-y: auto; background: var(--ds-white); box-shadow: var(--ds-shadow-lg); }
.tv-drawer.tv-slide { transition: transform var(--ds-duration) var(--ds-ease); }
.tv-drawer.is-out { transform: translateX(100%); }
.tv-drawer-head { position: sticky; top: 0; z-index: 1; display: flex; align-items: center; gap: var(--ds-space-md); padding: var(--ds-space-md) var(--ds-space-xl) var(--ds-space-md) var(--ds-space-4xl); border-bottom: 1px solid var(--ds-border); background: var(--ds-white); }
.tv-drawer-head .tv-icon-btn { margin-left: auto; }
.tv-pub { padding: var(--ds-space-4xl) var(--ds-space-4xl) var(--ds-space-6xl); color: var(--ds-grey-800); }
.tv-pub-meta { display: flex; align-items: center; justify-content: space-between; color: var(--ds-grey-500); font-size: var(--ds-text-intro-size); line-height: var(--ds-text-intro-lh); }
.tv-pub-icons { display: flex; gap: var(--ds-space-3xl); color: var(--ds-teal-800); }
.tv-pub-title { margin-top: var(--ds-space-2xl); color: var(--ds-grey-800); font-size: var(--ds-h1-size); line-height: var(--ds-h1-lh); font-weight: 700; }
.tv-pub-lead { margin-top: var(--ds-space-2xl); color: var(--ds-grey-800); font-size: var(--ds-text-md-size); line-height: 1.75; font-weight: 700; }
.tv-pub-h { margin-top: var(--ds-space-3xl); color: var(--ds-grey-800); font-size: var(--ds-text-md-size); line-height: var(--ds-text-md-lh); font-weight: 700; }
.tv-pub-q { margin-top: var(--ds-space-3xl); font-size: var(--ds-text-md-size); line-height: 1.75; white-space: pre-line; }
.tv-pub-body { margin-top: var(--ds-space-3xl); font-size: var(--ds-text-md-size); line-height: 1.75; }
.tv-pub-body p { margin: 0 0 var(--ds-space-xl); }
.tv-pub-body a { color: var(--ds-teal-500); text-decoration: none; }
.tv-pub .is-empty { color: var(--ds-text-faint); font-weight: 400; }

/* ---------- Procesas: naujienos, grąžinimai, pasiruošimas, rūšiavimas ---------- */
.tv-nav-new { flex: 0 0 auto; width: 7px; height: 7px; margin-left: calc(-1 * var(--ds-space-xs)); border-radius: 50%; background: var(--ds-salmon-500); }
.tv-row.is-new .tv-row-title { color: var(--ds-grey-900); font-weight: 700; }
.tv-row.is-new .tv-id::before { content: ''; display: inline-block; width: 7px; height: 7px; margin-right: var(--ds-space-sm); border-radius: 50%; background: var(--ds-salmon-500); vertical-align: 1px; }
.tv-event { padding: 0 var(--ds-space-sm); border-radius: var(--ds-radius-xs); background: var(--ds-salmon-100); color: var(--ds-salmon-800); font-size: var(--ds-caption-size); line-height: 18px; font-weight: 700; white-space: nowrap; }
.tv-row-return { display: flex; gap: var(--ds-space-xs); overflow: hidden; color: var(--ds-red-700); font-size: var(--ds-text-xs-size); line-height: var(--ds-text-xs-lh); white-space: nowrap; text-overflow: ellipsis; }
.tv-row-return > span:last-child { overflow: hidden; text-overflow: ellipsis; }
.tv-row-return svg { flex: 0 0 auto; margin-top: 2px; }

.tv-ready-wrap { position: relative; }
.tv-ready { gap: var(--ds-space-md); }
.tv-ready-bar { width: 40px; height: 6px; overflow: hidden; border-radius: var(--ds-radius-full); background: var(--ds-grey-200); }
.tv-ready-bar span { display: block; height: 100%; border-radius: inherit; background: var(--ds-orange-500); transition: width var(--ds-duration) var(--ds-ease); }
.tv-ready.is-done { border-color: var(--ds-green-300); background: var(--ds-green-100); color: var(--ds-green-800); }
.tv-ready.is-done .tv-ready-bar span { background: var(--ds-green-500); }
.tv-ready-menu { left: 0; right: auto; width: 260px; }
.tv-menu-head.is-plain { color: var(--ds-text-muted); }
.tv-check { display: flex; align-items: center; gap: var(--ds-space-md); width: 100%; padding: var(--ds-space-sm) var(--ds-space-md); border: 0; border-radius: var(--ds-radius-sm); background: none; color: var(--ds-grey-900); font-size: var(--ds-text-sm-size); text-align: left; }
.tv-check:hover { background: var(--ds-grey-100); }
.tv-check-ic { display: grid; place-items: center; width: 18px; height: 18px; border: 1px solid var(--ds-orange-300); border-radius: 50%; color: var(--ds-orange-700); }
.tv-check.is-ok { color: var(--ds-text-muted); }
.tv-check.is-ok .tv-check-ic { border-color: var(--ds-green-500); background: var(--ds-green-500); color: var(--ds-white); }

.tv-missing { padding: var(--ds-space-md) var(--ds-space-lg); border-radius: var(--ds-radius-sm); background: var(--ds-orange-100); color: var(--ds-orange-900); font-size: var(--ds-text-xs-size); }
.tv-missing .tv-chips { margin-top: var(--ds-space-sm); }
.tv-chip.is-warn { padding: 0 var(--ds-space-lg); border-color: var(--ds-orange-300); }
.tv-chip.is-warn:hover { background: var(--ds-white); }

.tv-triage { padding: var(--ds-space-lg) var(--ds-space-xl); border: 1px solid var(--ds-border); border-radius: var(--ds-radius-md); }
.tv-triage-head { display: flex; align-items: center; gap: var(--ds-space-sm); margin-bottom: var(--ds-space-sm); color: var(--ds-grey-700); font-size: var(--ds-text-xs-size); font-weight: 700; }
.tv-triage-row { display: flex; align-items: center; gap: var(--ds-space-md); padding: var(--ds-space-xs) 0; }
.tv-triage-title { flex: 1; min-width: 0; }
.tv-triage .tv-match { margin-left: 0; }
.tv-triage-hint { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--ds-space-md); margin-top: var(--ds-space-md); padding: var(--ds-space-md) var(--ds-space-lg); border-radius: var(--ds-radius-sm); background: var(--ds-blue-100); color: var(--ds-blue-800); font-size: var(--ds-text-xs-size); }

/* ---------- Savybės (Notion principu) ---------- */
.tv-props { display: flex; flex-direction: column; gap: var(--ds-space-xxs); padding-bottom: var(--ds-space-lg); border-bottom: 1px solid var(--ds-border); }
.tv-prop { position: relative; display: grid; grid-template-columns: 148px minmax(0, 1fr); align-items: center; min-height: 34px; }
.tv-prop-k { display: flex; align-items: center; gap: var(--ds-space-md); color: var(--ds-text-muted); }
.tv-prop-k svg { color: var(--ds-grey-500); }
.tv-prop-v { justify-self: start; display: inline-flex; align-items: center; gap: var(--ds-space-sm); max-width: 100%; min-height: 30px; margin-left: calc(-1 * var(--ds-space-md)); padding: 0 var(--ds-space-md); border: 0; border-radius: var(--ds-radius-sm); background: none; color: var(--ds-grey-900); font-size: var(--ds-text-sm-size); text-align: left; }
button.tv-prop-v:not(:disabled):hover { background: var(--ds-grey-100); }
button.tv-prop-v:disabled { cursor: default; }
.tv-prop-v.is-empty { color: var(--ds-text-faint); }
.tv-prop-v.is-wrap { flex-wrap: wrap; padding-block: var(--ds-space-xs); }
.tv-prop-v .tv-age { margin-left: 0; }
.tv-prop-menu { top: calc(100% - var(--ds-space-xxs)); left: 140px; right: auto; width: 280px; }
.tv-menu-item.is-plain { display: flex; align-items: center; gap: var(--ds-space-md); padding: var(--ds-space-sm) var(--ds-space-md); font-weight: 400; }
.tv-menu-item.is-plain:hover { background: var(--ds-grey-100); }
.tv-menu-item.is-on { background: var(--ds-teal-100); font-weight: 600; }
.tv-menu-item small { margin-left: auto; color: var(--ds-text-muted); }

/* ---------- Po pirmos peržiūros (Roundas 1) ---------- */
.tv-textarea::placeholder { color: var(--ds-text-faint); }
.tv-field-head .tv-field-link { margin-left: auto; }
.tv-field-head .tv-field-link + .tv-di-ic { margin-left: 0; }
.is-flash { animation: tv-flash 1.2s var(--ds-ease); }
@keyframes tv-flash { 0% { box-shadow: 0 0 0 4px var(--ds-purple-200); } 100% { box-shadow: 0 0 0 4px transparent; } }

/* Trumpas paaiškinimas užvedus (data-tip) */
[data-tip] { position: relative; }
[data-tip]::after { content: attr(data-tip); position: absolute; top: calc(100% + 6px); right: 0; z-index: 30; padding: var(--ds-space-xs) var(--ds-space-md); border-radius: var(--ds-radius-sm); background: var(--ds-grey-900); color: var(--ds-white); font-size: var(--ds-text-xs-size); line-height: var(--ds-text-xs-lh); font-weight: 600; white-space: nowrap; opacity: 0; pointer-events: none; transform: translateY(-2px); transition: opacity var(--ds-duration-fast) ease, transform var(--ds-duration-fast) ease; }
[data-tip]:hover::after, [data-tip]:focus-visible::after { opacity: 1; transform: none; transition-delay: .25s; }

/* DI ikona prie laukelio */
.tv-di-ic { display: inline-grid; place-items: center; flex: 0 0 auto; width: 28px; height: 28px; margin-left: auto; padding: 0; border: 0; border-radius: var(--ds-radius-sm); background: none; color: var(--ds-purple-500); transition: background var(--ds-duration-fast) ease, color var(--ds-duration-fast) ease; }
.tv-di-ic:hover { background: var(--tv-di-bg); color: var(--tv-di); }
.tv-title-field .tv-di-ic { margin-top: var(--ds-space-xs); }

/* DI santrauka: subtilūs veiksmai */
.tv-di-mark { display: inline-grid; color: var(--ds-purple-500); }
.tv-di-card header b { color: var(--ds-grey-800); }
.tv-di-link { display: inline-flex; align-items: center; gap: var(--ds-space-xs); height: 28px; padding: 0 var(--ds-space-md); border: 1px solid var(--ds-purple-200); border-radius: var(--ds-radius-full); background: var(--ds-white); color: var(--tv-di); font-size: var(--ds-text-xs-size); font-weight: 600; }
.tv-di-link:hover { background: var(--tv-di-bg); }
.tv-di-link:disabled span:first-child { animation: tv-pulse 1s ease-in-out infinite; }
.tv-di-link.is-quiet { border-color: transparent; }
.tv-cite { background: var(--ds-grey-200); color: var(--ds-grey-700); }
.tv-cite[data-n]:hover { background: var(--ds-purple-200); color: var(--ds-purple-800); }

/* Citatos tooltip */
.tv-tip { position: fixed; z-index: 70; width: 280px; padding: var(--ds-space-md) var(--ds-space-lg); border: 1px solid var(--ds-border); border-radius: var(--ds-radius-md); background: var(--ds-white); box-shadow: var(--ds-shadow-md); pointer-events: none; }
.tv-tip-meta { font-size: var(--ds-caption-size); line-height: var(--ds-caption-lh); }
.tv-tip-kind { color: var(--ds-teal-700); font-weight: 700; }
.tv-tip-kind.is-ext { color: var(--ds-blue-700); }
.tv-tip-title { margin-top: var(--ds-space-xxs); color: var(--ds-grey-900); font-size: var(--ds-text-xs-size); line-height: var(--ds-text-xs-lh); font-weight: 600; }

/* DI skydelio variantai: Įterpti / Kopijuoti */
.tv-chat-empty { margin: auto 0; color: var(--ds-text-muted); font-size: var(--ds-text-xs-size); text-align: center; }
.tv-chat-empty span { display: inline-grid; color: var(--ds-purple-500); vertical-align: -2px; }
.tv-opts { display: flex; flex-direction: column; gap: var(--ds-space-sm); }
.tv-opt { padding: var(--ds-space-md) var(--ds-space-lg); border: 1px solid var(--ds-border); border-radius: var(--ds-radius-md); background: var(--ds-white); }
.tv-opt > p { color: var(--ds-grey-900); font-size: var(--ds-text-sm-size); line-height: 1.5; }
.tv-opt-actions { display: flex; align-items: center; gap: var(--ds-space-xs); margin-top: var(--ds-space-sm); }
.tv-opt-actions .tv-icon-btn { margin-left: auto; }
.tv-opt.is-used { border-color: var(--ds-green-300); background: var(--ds-green-100); }
.tv-opt.is-used .tv-di-link { border-color: var(--ds-green-300); color: var(--ds-green-800); }
.tv-msg.is-ai:has(.tv-opts) { max-width: 100%; align-self: stretch; }

/* Tagų parinkiklis */
.tv-tagpick { border: 1px solid var(--ds-border-strong); border-radius: var(--ds-radius-md); background: var(--ds-white); }
.tv-find.is-in { margin: var(--ds-space-md); }
.tv-tagpick-list { max-height: 300px; overflow-y: auto; margin: 0 var(--ds-space-md); border: 1px solid var(--ds-border); border-radius: var(--ds-radius-sm); }
.tv-tagpick-group + .tv-tagpick-group { border-top: 1px solid var(--ds-border); }
.tv-tagpick-group.is-di { background: var(--tv-di-bg); }
.tv-tagpick-cat { display: flex; align-items: center; gap: var(--ds-space-sm); width: 100%; margin: 0; padding: var(--ds-space-sm) var(--ds-space-md); border: 0; background: none; color: var(--ds-grey-800); font-size: var(--ds-text-sm-size); font-weight: 600; text-align: left; }
.tv-tagpick-group.is-di .tv-tagpick-cat { color: var(--tv-di); font-size: var(--ds-text-xs-size); }
.tv-tagpick-cat.is-btn:hover { background: var(--ds-grey-100); }
.tv-tagpick-cat .tv-muted { font-weight: 400; font-size: var(--ds-text-xs-size); }
.tv-tagpick-chev { display: inline-grid; color: var(--ds-grey-500); transition: transform var(--ds-duration) var(--ds-ease); }
.tv-tagpick-chev.is-open { transform: rotate(90deg); }
.tv-tagpick-row { display: flex; align-items: center; gap: var(--ds-space-md); padding: var(--ds-space-xs) var(--ds-space-md); font-size: var(--ds-text-sm-size); cursor: pointer; }
.tv-tagpick-row:hover { background: var(--ds-grey-100); }
.tv-tagpick-row.is-child { padding-left: var(--ds-space-4xl); }
.tv-tagpick-row input { accent-color: var(--ds-teal-600); }
.tv-tagpick-row small { margin-left: auto; color: var(--ds-text-muted); font-size: var(--ds-text-xs-size); }
.tv-tagpick-empty { padding: var(--ds-space-md); }
.tv-tagpick-foot { display: flex; align-items: center; gap: var(--ds-space-md); padding: var(--ds-space-md); }
.tv-suggest-label { color: var(--tv-di); }

/* Sąrašo režimas (list view) */
.tv-list-head { align-items: center; }
.tv-viewmode { margin-left: auto; }
.tv-viewmode button { min-width: 30px; padding: 0 var(--ds-space-sm); }
.tv-viewmode [data-tip]::after { right: auto; left: 50%; transform: translate(-50%, -2px); }
.tv-viewmode [data-tip]:hover::after { transform: translate(-50%, 0); }
.tv-inbox.is-table { grid-template-columns: minmax(0, 1fr); }
.tv-inbox.is-table .tv-list { border-right: 0; }
.tv-table { width: 100%; border-collapse: collapse; font-size: var(--ds-text-sm-size); }
.tv-table th { position: sticky; top: 0; z-index: 1; padding: var(--ds-space-md) var(--ds-space-lg); border-bottom: 1px solid var(--ds-border); background: var(--ds-white); color: var(--ds-text-muted); font-size: var(--ds-text-xs-size); font-weight: 600; text-align: left; white-space: nowrap; }
.tv-table td { padding: var(--ds-space-md) var(--ds-space-lg); border-bottom: 1px solid var(--ds-border); vertical-align: middle; }
.tv-table th:first-child, .tv-table td:first-child { padding-left: var(--ds-space-2xl); }
.tv-table-row { cursor: pointer; transition: background var(--ds-duration-fast) ease; }
.tv-table-row:hover { background: var(--ds-grey-100); }
.tv-table-row td.tv-id { white-space: nowrap; }
.tv-table-row td.tv-id .tv-prio { margin-left: var(--ds-space-xs); vertical-align: -2px; }
.tv-table-title { max-width: 520px; }
.tv-table-title > span:first-child { display: -webkit-box; overflow: hidden; color: var(--ds-grey-900); font-weight: 600; -webkit-line-clamp: 1; -webkit-box-orient: vertical; }
.tv-table-title > span.is-raw { font-weight: 400; }
.tv-table-title .tv-event, .tv-table-title .tv-type { display: inline-block; margin-top: var(--ds-space-xxs); margin-right: var(--ds-space-xs); }
.tv-table-row.is-new .tv-table-title > span:first-child { font-weight: 700; }
.tv-table-row.is-new td.tv-id::before { content: ''; display: inline-block; width: 7px; height: 7px; margin-right: var(--ds-space-sm); border-radius: 50%; background: var(--ds-salmon-500); vertical-align: 1px; }
.tv-table-group td { padding-block: var(--ds-space-sm); background: var(--ds-grey-100); color: var(--ds-grey-700); font-size: var(--ds-text-xs-size); font-weight: 700; }
.tv-person { display: inline-flex; align-items: center; gap: var(--ds-space-sm); white-space: nowrap; }
