/* Tabula in operation. Every rule is scoped under .tlive.
   Product tokens follow the shipped Tabula build (Metron interface tokens,
   slate accent). Site chrome (step tabs) uses Host Grotesk. */

.tlive {
  --tl-canvas: #f5f6f8;
  --tl-surface: #ffffff;
  --tl-subtle: #eef1f4;
  --tl-text: #1c2127;
  --tl-muted: #5c6674;
  --tl-line: #d7dce2;
  --tl-control-line: #7d8795;
  --tl-accent: #455566;
  --tl-accent-hover: #36434f;
  --tl-accent-soft: #eaf0f4;
  --tl-success: #236342;
  --tl-success-soft: #eaf4ed;
  --tl-warning: #80550d;
  --tl-warning-soft: #fff4dd;
  --tl-danger: #a82e36;
  --tl-danger-soft: #fcecee;
  --tl-info: #465ab7;
  --tl-info-soft: #edf0fc;
  --tl-font: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --tl-mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --tl-site-font: "Host Grotesk", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
  --tl-site-ink: #141414;
  --tl-site-quiet: #8a8985;
  --tl-site-rule: #e2e0db;

  display: block;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  font-family: var(--tl-site-font);
  color: var(--tl-site-ink);
  -webkit-font-smoothing: antialiased;
}

.tlive *,
.tlive *::before,
.tlive *::after {
  box-sizing: border-box;
}

.tlive [hidden] {
  display: none !important;
}

.tlive h2,
.tlive h3,
.tlive p,
.tlive ol,
.tlive dl,
.tlive dd {
  margin: 0;
  padding: 0;
}

.tlive ol {
  list-style: none;
}

/* ---------- Step tabs (site chrome) ---------- */

.tlive .tl-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
  margin: 0 0 28px;
}

.tlive .tl-tab {
  position: relative;
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin: 0;
  padding: 16px 0 0;
  border: 0;
  border-top: 1px solid var(--tl-site-rule);
  background: none;
  font: 400 15px/1.35 var(--tl-site-font);
  color: var(--tl-site-quiet);
  text-align: left;
  cursor: pointer;
  transition: color 0.2s ease;
}

.tlive .tl-tab:hover {
  color: var(--tl-site-ink);
}

.tlive .tl-tab:focus-visible {
  outline: 1px solid var(--tl-site-ink);
  outline-offset: 4px;
}

.tlive .tl-tab.is-active {
  color: var(--tl-site-ink);
}

.tlive .tl-tab-num {
  font-variant-numeric: tabular-nums;
  flex: 0 0 auto;
}

.tlive .tl-tab-bar {
  position: absolute;
  left: 0;
  top: -1px;
  width: 100%;
  height: 1px;
  background: var(--tl-site-ink);
  transform: scaleX(0);
  transform-origin: 0 50%;
}

/* ---------- Stage and window ---------- */

.tlive .tl-stage {
  position: relative;
  width: 100%;
  height: 680px;
}

.tlive .tl-win {
  position: absolute;
  top: 0;
  left: 0;
  width: 1200px;
  height: 680px;
  transform-origin: 0 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--tl-line);
  border-radius: 10px;
  background: var(--tl-canvas);
  box-shadow: 0 1px 2px rgb(20 20 20 / 4%), 0 24px 60px -28px rgb(20 20 20 / 28%);
  font-family: var(--tl-font);
  font-size: 13px;
  line-height: 1.45;
  color: var(--tl-text);
  text-align: left;
  user-select: none;
  -webkit-user-select: none;
}

.tlive .tl-ico {
  display: block;
  flex: 0 0 auto;
  fill: currentColor;
}

/* ---------- Top bar ---------- */

.tlive .tl-top {
  flex: 0 0 48px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 16px;
  background: var(--tl-surface);
  border-bottom: 1px solid var(--tl-line);
  position: relative;
  z-index: 2;
}

.tlive .tl-brand {
  font-weight: 600;
  font-size: 16px;
  letter-spacing: -0.015em;
}

.tlive .tl-ws {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 28px;
  padding-left: 12px;
  border-left: 1px solid var(--tl-line);
  font-weight: 500;
}

.tlive .tl-ws-name {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 6px;
}

.tlive .tl-role {
  color: var(--tl-muted);
  font-size: 12px;
}

.tlive .tl-top-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 4px;
}

.tlive .tl-tbtn {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 32px;
  padding: 0 10px;
  border-radius: 3px;
  transition: background-color 0.25s ease, color 0.25s ease;
}

.tlive .tl-tbtn.is-on {
  background: var(--tl-accent-soft);
  color: var(--tl-accent);
  font-weight: 500;
}

.tlive .tl-kbd {
  color: var(--tl-muted);
  font-size: 12px;
  margin: 0 14px 0 10px;
}

/* ---------- Sidebar ---------- */

.tlive .tl-body {
  flex: 1;
  display: flex;
  min-height: 0;
}

.tlive .tl-side {
  flex: 0 0 auto;
  width: 208px;
  padding: 6px 0;
  overflow: hidden;
  background: var(--tl-surface);
  border-right: 1px solid var(--tl-line);
  transition: width 0.45s cubic-bezier(0.4, 0, 0.2, 1);
}

.tlive .tl-ngroup {
  padding: 4px 12px;
  transition: padding 0.45s cubic-bezier(0.4, 0, 0.2, 1);
}

.tlive .tl-nlabel {
  height: 28px;
  padding: 7px 0 0;
  color: var(--tl-muted);
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  transition: height 0.45s ease, opacity 0.3s ease, padding 0.45s ease;
}

.tlive .tl-nitem {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 32px;
  padding: 0 12px;
  border-radius: 3px;
  white-space: nowrap;
  overflow: hidden;
  transition: background-color 0.25s ease, color 0.25s ease;
}

.tlive .tl-nitem .tl-nl {
  transition: opacity 0.25s ease;
}

.tlive .tl-nitem.is-sel {
  background: var(--tl-accent-soft);
  color: var(--tl-accent);
  font-weight: 500;
}

.tlive .tl-ncount {
  margin-left: auto;
  padding: 0 7px;
  border-radius: 3px;
  background: var(--tl-subtle);
  color: var(--tl-muted);
  font-size: 12px;
  font-weight: 400;
  font-variant-numeric: tabular-nums;
  transition: opacity 0.25s ease;
}

.tlive .tl-nitem.is-sel .tl-ncount {
  background: var(--tl-surface);
  color: var(--tl-accent);
}

.tlive .tl-apps {
  display: none;
}

.tlive .is-rail .tl-side {
  width: 56px;
}

.tlive .is-rail .tl-ngroup {
  padding: 4px 8px;
}

.tlive .is-rail .tl-nlabel {
  height: 9px;
  padding: 0;
  opacity: 0;
}

.tlive .is-rail .tl-nl,
.tlive .is-rail .tl-ncount {
  opacity: 0;
}

.tlive .is-rail .tl-apps {
  display: block;
}

.tlive .is-rail .tl-apps .tl-nlabel {
  height: 13px;
  opacity: 1;
  color: transparent;
  border-top: 1px solid var(--tl-line);
  margin-top: 4px;
}

/* ---------- Main area and shared product parts ---------- */

.tlive .tl-main {
  flex: 1;
  min-width: 0;
  display: flex;
  position: relative;
  overflow: hidden;
}

.tlive .tl-scene {
  flex: 1;
  min-width: 0;
  display: flex;
  animation: tl-fade 0.35s ease both;
}

.tlive .tl-page {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 16px 20px 20px;
}

.tlive .tl-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  min-height: 48px;
}

.tlive .tl-crumb {
  color: var(--tl-muted);
  font-size: 12px;
  margin-bottom: 2px;
}

.tlive .tl-h1 {
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.012em;
  line-height: 1.2;
}

.tlive .tl-actions {
  display: flex;
  gap: 8px;
  position: relative;
}

.tlive .tl-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 10px;
  border-radius: 3px;
  background: var(--tl-surface);
  box-shadow: inset 0 0 0 1px var(--tl-control-line);
  white-space: nowrap;
  transition: transform 0.12s ease, background-color 0.2s ease;
}

.tlive .tl-btn.is-primary {
  background: var(--tl-accent);
  color: #fff;
  box-shadow: none;
  font-weight: 500;
}

.tlive .tl-btn.is-press,
.tlive .tl-press.is-press {
  transform: scale(0.97);
}

.tlive .tl-btn.is-primary.is-press {
  background: var(--tl-accent-hover);
}

.tlive .tl-btn:not(.is-primary).is-press {
  background: var(--tl-subtle);
}

.tlive .tl-panel {
  background: var(--tl-surface);
  border: 1px solid var(--tl-line);
  min-width: 0;
}

.tlive .tl-panel-h {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  height: 40px;
  padding: 0 12px;
  border-bottom: 1px solid var(--tl-line);
  font-weight: 600;
}

.tlive .tl-panel-h .tl-count {
  font-weight: 400;
}

.tlive .tl-filter {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px;
  border-bottom: 1px solid var(--tl-line);
}

.tlive .tl-input {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  height: 32px;
  padding: 0 8px;
  border-radius: 3px;
  box-shadow: inset 0 0 0 1px var(--tl-control-line);
  color: var(--tl-muted);
  white-space: nowrap;
}

.tlive .tl-select {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  height: 32px;
  min-width: 150px;
  padding: 0 6px 0 8px;
  border-radius: 3px;
  box-shadow: inset 0 0 0 1px var(--tl-control-line);
  background: var(--tl-surface);
  white-space: nowrap;
}

.tlive .tl-count {
  color: var(--tl-muted);
  font-size: 12px;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.tlive .tl-filter .tl-count {
  margin-left: 4px;
}

.tlive .tl-thead,
.tlive .tl-tr {
  display: grid;
  align-items: center;
  column-gap: 0;
}

.tlive .tl-thead {
  height: 36px;
  background: var(--tl-subtle);
  color: var(--tl-muted);
  font-weight: 500;
}

.tlive .tl-thead > div,
.tlive .tl-tr > div {
  padding: 0 12px;
  min-width: 0;
}

.tlive .tl-tr {
  min-height: 44px;
  padding: 7px 0;
  border-bottom: 1px solid var(--tl-line);
  transition: background-color 0.3s ease;
}

.tlive .tl-tr.is-sel {
  background: var(--tl-accent-soft);
}

.tlive .tl-r {
  text-align: right;
  justify-self: end;
}

.tlive .tl-num {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.tlive .tl-strong {
  font-weight: 500;
}

.tlive .tl-sub {
  color: var(--tl-muted);
  font-size: 12px;
  line-height: 1.35;
  margin-top: 1px;
}

.tlive .tl-muted {
  color: var(--tl-muted);
}

.tlive code,
.tlive .tl-mono {
  font-family: var(--tl-mono);
  font-size: 11.5px;
  color: var(--tl-muted);
  background: none;
}

.tlive .tl-pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 38px;
  padding: 0 12px;
  color: var(--tl-muted);
  font-size: 12px;
}

.tlive .tl-pager-nav {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--tl-muted);
}

.tlive .tl-pager-nav .tl-ico {
  opacity: 0.45;
}

/* Status tags */
.tlive .tl-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 20px;
  padding: 0 6px;
  border-radius: 3px;
  background: var(--tl-subtle);
  color: var(--tl-muted);
  font-size: 12px;
  font-weight: 400;
  line-height: 1;
  white-space: nowrap;
  vertical-align: middle;
}

.tlive .tl-tag.t-ok { color: var(--tl-success); background: var(--tl-success-soft); }
.tlive .tl-tag.t-warn { color: var(--tl-warning); background: var(--tl-warning-soft); }
.tlive .tl-tag.t-bad { color: var(--tl-danger); background: var(--tl-danger-soft); }
.tlive .tl-tag.t-info { color: var(--tl-info); background: var(--tl-info-soft); }

.tlive .tl-tag .tl-ico {
  width: 12px;
  height: 12px;
}

.tlive .tl-spin {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 1.5px solid currentColor;
  border-right-color: transparent;
  animation: tl-rot 0.75s linear infinite;
}

/* Source chips: where a value comes from */
.tlive .tl-src {
  display: inline-flex;
  align-items: center;
  height: 17px;
  padding: 0 5px;
  border: 1px solid var(--tl-line);
  border-radius: 3px;
  background: var(--tl-surface);
  color: var(--tl-muted);
  font-size: 10.5px;
  font-weight: 500;
  line-height: 1;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.tlive .tl-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 4px;
}

.tlive .tl-in {
  animation: tl-in 0.42s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

.tlive .tl-pop {
  animation: tl-pop 0.5s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

/* ---------- Cursor ---------- */

.tlive .tl-cursor {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 40;
  width: 17px;
  height: 22px;
  pointer-events: none;
  opacity: 0;
  transition-property: transform, opacity;
  transition-duration: 0.5s, 0.3s;
  transition-timing-function: cubic-bezier(0.45, 0, 0.2, 1), ease;
  filter: drop-shadow(0 1px 1.5px rgb(0 0 0 / 22%));
}

.tlive .tl-cursor svg {
  display: block;
}

.tlive .tl-ripple {
  position: absolute;
  z-index: 39;
  width: 26px;
  height: 26px;
  margin: -13px 0 0 -13px;
  border-radius: 50%;
  border: 1.5px solid rgb(69 85 102 / 55%);
  pointer-events: none;
  animation: tl-ripple 0.55s ease-out forwards;
}

/* ---------- Menu ---------- */

.tlive .tl-menu {
  position: absolute;
  top: 38px;
  right: 0;
  z-index: 20;
  width: 196px;
  padding: 4px;
  border-radius: 4px;
  background: var(--tl-surface);
  box-shadow: 0 0 0 1px rgb(28 33 39 / 10%), 0 4px 16px rgb(28 33 39 / 14%);
  opacity: 0;
  transform: translateY(-4px);
  visibility: hidden;
  transition: opacity 0.16s ease, transform 0.16s ease, visibility 0s linear 0.16s;
}

.tlive .tl-menu.is-open {
  opacity: 1;
  transform: none;
  visibility: visible;
  transition: opacity 0.16s ease, transform 0.16s ease, visibility 0s;
}

.tlive .tl-menu-h {
  padding: 6px 8px 4px;
  color: var(--tl-muted);
  font-size: 12px;
}

.tlive .tl-mi {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 30px;
  padding: 0 8px;
  border-radius: 3px;
  transition: background-color 0.15s ease;
}

.tlive .tl-mi.is-hot {
  background: var(--tl-accent-soft);
  color: var(--tl-accent);
}

/* ---------- Scene 1: sources ---------- */

.tlive .tl-s1 {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 296px;
  gap: 16px;
}

.tlive .tl-s1-left {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-height: 0;
}

.tlive .tl-cols-src {
  grid-template-columns: minmax(0, 1fr) 100px 124px 196px;
}

.tlive .tl-src-rows .tl-tr {
  min-height: 50px;
}

.tlive .tl-log {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.tlive .tl-log-body {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  padding: 6px 0;
}

.tlive .tl-log-line {
  display: grid;
  grid-template-columns: 66px 78px minmax(0, 1fr) auto;
  align-items: center;
  height: 26px;
  padding: 0 12px;
  white-space: nowrap;
}

.tlive .tl-log-line .tl-mono {
  font-size: 11.5px;
}

.tlive .tl-ent {
  display: flex;
  flex-direction: column;
  align-self: start;
}

.tlive .tl-ent-row {
  padding: 10px 12px;
  border-bottom: 1px solid var(--tl-line);
}

.tlive .tl-ent-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.tlive .tl-ent-name {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
}

.tlive .tl-ent-name .tl-ico {
  color: var(--tl-muted);
}

.tlive .tl-ent-count {
  font-size: 15px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.tlive .tl-ent-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 5px;
}

.tlive .tl-ent-meta .tl-chips {
  margin-top: 0;
}

.tlive .tl-ent-in {
  font-size: 12px;
  white-space: nowrap;
}

.tlive .tl-ent-empty {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.tlive .tl-skel {
  height: 10px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--tl-subtle) 0%, #f7f8fa 50%, var(--tl-subtle) 100%);
  background-size: 200% 100%;
  animation: tl-shimmer 1.4s linear infinite;
}

.tlive .tl-figs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-top: 1px solid var(--tl-line);
  margin-top: -1px;
}

.tlive .tl-fig {
  padding: 10px 12px 12px;
}

.tlive .tl-fig + .tl-fig {
  border-left: 1px solid var(--tl-line);
}

.tlive .tl-fig-k {
  color: var(--tl-muted);
  font-size: 12px;
}

.tlive .tl-fig-v {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
  margin-top: 2px;
}

/* ---------- Scene 2: model ---------- */

.tlive .tl-s2 {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.tlive .tl-cols-def {
  grid-template-columns: minmax(0, 1fr) 70px 108px;
}

.tlive .tl-def-rows .tl-tr {
  min-height: 52px;
  padding: 6px 0;
}

.tlive .tl-record {
  opacity: 0;
  transform: translateX(8px);
  transition: opacity 0.35s ease, transform 0.45s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.tlive .tl-record.is-open {
  opacity: 1;
  transform: none;
}

.tlive .tl-rec-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 14px 16px 12px;
  border-bottom: 1px solid var(--tl-line);
}

.tlive .tl-eyebrow {
  color: var(--tl-muted);
  font-size: 12px;
}

.tlive .tl-rec-title {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.3;
}

.tlive .tl-rec-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
}

.tlive .tl-rec-meta code {
  font-size: 12.5px;
  color: var(--tl-text);
}

.tlive .tl-sec-h {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 36px;
  padding: 0 16px;
  font-weight: 600;
}

.tlive .tl-sec-h .tl-count {
  font-weight: 400;
}

.tlive .tl-sec + .tl-sec {
  border-top: 1px solid var(--tl-line);
}

.tlive .tl-cols-prop {
  grid-template-columns: 160px minmax(0, 1fr) 72px 124px;
}

.tlive .tl-sec .tl-thead {
  height: 30px;
  font-size: 12px;
}

.tlive .tl-sec .tl-thead > div:first-child,
.tlive .tl-sec .tl-tr > div:first-child {
  padding-left: 16px;
}

.tlive .tl-sec .tl-thead > div:last-child,
.tlive .tl-sec .tl-tr > div:last-child {
  padding-right: 16px;
}

.tlive .tl-prop-rows .tl-tr {
  min-height: 36px;
  padding: 4px 0;
}

.tlive .tl-prop-rows .tl-tr:last-child {
  border-bottom: 0;
}

.tlive .tl-map {
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.tlive .tl-arrow {
  color: var(--tl-muted);
  font-size: 13px;
}

.tlive .tl-map code {
  color: var(--tl-text);
  font-size: 12px;
}

.tlive .tl-cov {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.tlive .tl-cov-bar {
  width: 28px;
  height: 4px;
  border-radius: 2px;
  background: var(--tl-subtle);
  overflow: hidden;
}

.tlive .tl-cov-bar i {
  display: block;
  height: 100%;
  width: 0;
  background: var(--tl-accent);
}

.tlive .tl-linkrow {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 0 16px 8px;
}

.tlive .tl-obj {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 26px;
  padding: 0 8px;
  border: 1px solid var(--tl-line);
  border-radius: 3px;
  font-weight: 500;
  background: var(--tl-surface);
}

.tlive .tl-obj .tl-ico {
  color: var(--tl-muted);
  width: 14px;
  height: 14px;
}

.tlive .tl-verb {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--tl-muted);
}

.tlive .tl-verb::before,
.tlive .tl-verb::after {
  content: "";
  width: 18px;
  height: 1px;
  background: var(--tl-control-line);
}

.tlive .tl-linkrow .tl-num {
  margin-left: auto;
}

.tlive .tl-cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 12px 16px 16px;
  border-top: 1px solid var(--tl-line);
}

.tlive .tl-card {
  min-height: 92px;
  padding: 10px 12px 12px;
  border: 1px solid var(--tl-line);
  border-radius: 3px;
  background: var(--tl-surface);
}

.tlive .tl-card.is-ghost {
  visibility: hidden;
}

.tlive .tl-card-h {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
  color: var(--tl-muted);
  font-size: 12px;
}

.tlive .tl-deftext {
  min-height: 20px;
  font-size: 13.5px;
}

.tlive .tl-deftext b {
  font-weight: 600;
}

.tlive .tl-caret {
  display: inline-block;
  width: 1px;
  height: 15px;
  margin-left: 1px;
  vertical-align: -2px;
  background: var(--tl-text);
  animation: tl-blink 1s steps(1) infinite;
}

.tlive .tl-card-foot {
  margin-top: 6px;
  color: var(--tl-muted);
  font-size: 12px;
}

.tlive .tl-actline {
  font-size: 13.5px;
}

.tlive .tl-actline strong {
  display: block;
  margin-bottom: 2px;
}

.tlive .tl-actmeta {
  display: flex;
  align-items: center;
  gap: 8px;
}

.tlive .tl-actline .tl-dot {
  color: var(--tl-muted);
}

.tlive .tl-actline strong {
  font-weight: 600;
}

.tlive .tl-who {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.tlive .tl-who .tl-ico {
  width: 13px;
  height: 13px;
  color: var(--tl-muted);
}

/* ---------- Scene 3: solutions ---------- */

.tlive .tl-cols-app {
  grid-template-columns: minmax(0, 1fr) 112px 160px 112px 150px;
}

.tlive .tl-app-rows .tl-tr {
  min-height: 56px;
  padding: 6px 0;
  align-items: start;
}

.tlive .tl-app-rows .tl-tr > div {
  padding-top: 2px;
}

.tlive .tl-app-rows .tl-tr:last-child {
  border-bottom: 0;
}

.tlive .tl-val {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.tlive .tl-val .tl-muted {
  font-size: 12px;
}

.tlive .tl-hl {
  animation: tl-hl 1.6s ease;
}

.tlive .tl-binds {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  padding: 10px 12px 12px;
}

.tlive .tl-binds .tl-sep {
  width: 1px;
  height: 18px;
  margin: 0 4px;
  background: var(--tl-line);
}

.tlive .tl-chat {
  flex: 0 0 384px;
  width: 384px;
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: var(--tl-surface);
  border-left: 1px solid var(--tl-line);
}

.tlive .tl-chat-h {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 44px;
  flex: 0 0 44px;
  padding: 0 12px 0 16px;
  border-bottom: 1px solid var(--tl-line);
}

.tlive .tl-chat-h strong {
  font-weight: 600;
}

.tlive .tl-chat-h .tl-chat-h-r {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--tl-muted);
  font-size: 12px;
}

.tlive .tl-chat-msgs {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  padding: 14px 16px;
}

.tlive .tl-msg + .tl-msg {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--tl-line);
}

.tlive .tl-msg-h {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 20px;
}

.tlive .tl-msg-h strong {
  color: var(--tl-muted);
  font-size: 12px;
  font-weight: 600;
}

.tlive .tl-msg p {
  margin-top: 4px;
  font-size: 13.5px;
  line-height: 1.5;
}

.tlive .tl-reads {
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.tlive .tl-reads li {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 22px;
  color: var(--tl-muted);
  font-size: 12px;
}

.tlive .tl-reads li .tl-src {
  margin-left: auto;
}

.tlive .tl-cite {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 15px;
  height: 15px;
  padding: 0 3px;
  border-radius: 3px;
  background: var(--tl-subtle);
  color: var(--tl-accent);
  font-size: 10px;
  font-weight: 600;
  line-height: 1;
  vertical-align: 1px;
  font-variant-numeric: tabular-nums;
}

.tlive .tl-answer {
  min-height: 0;
}

.tlive .tl-answer .tl-cite {
  margin: 0 1px;
}

.tlive .tl-approval {
  margin-top: 12px;
  padding: 10px 12px 12px;
  border: 1px solid var(--tl-line);
  border-left: 3px solid var(--tl-warning);
  border-radius: 3px;
  background: var(--tl-surface);
}

.tlive .tl-appr-h {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--tl-muted);
  font-size: 12px;
}

.tlive .tl-appr-t {
  margin-top: 6px;
  font-weight: 600;
  font-size: 13.5px;
}

.tlive .tl-appr-m {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  row-gap: 2px;
  margin-top: 6px;
  font-size: 12px;
}

.tlive .tl-appr-m dt {
  color: var(--tl-muted);
}

.tlive .tl-chat-comp {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px;
  border-top: 1px solid var(--tl-line);
}

.tlive .tl-comp-box {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  height: 34px;
  padding: 0 10px;
  border-radius: 3px;
  box-shadow: inset 0 0 0 1px var(--tl-control-line);
  white-space: nowrap;
  overflow: hidden;
  transition: box-shadow 0.2s ease;
}

.tlive .tl-comp-box.is-focus {
  box-shadow: inset 0 0 0 2px var(--tl-accent);
}

.tlive .tl-comp-ph {
  color: var(--tl-muted);
}

.tlive .tl-comp-text {
  overflow: hidden;
  text-overflow: clip;
  direction: rtl;
  text-align: left;
  unicode-bidi: plaintext;
}

.tlive .tl-send {
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 3px;
  background: var(--tl-accent);
  color: #fff;
  transition: transform 0.12s ease, background-color 0.2s ease;
}

/* ---------- Motion ---------- */

@keyframes tl-fade {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes tl-in {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: none; }
}

@keyframes tl-pop {
  from { opacity: 0; transform: translateY(6px) scale(0.985); }
  to { opacity: 1; transform: none; }
}

@keyframes tl-rot {
  to { transform: rotate(360deg); }
}

@keyframes tl-ripple {
  from { opacity: 1; transform: scale(0.4); }
  to { opacity: 0; transform: scale(1.25); }
}

@keyframes tl-blink {
  50% { opacity: 0; }
}

@keyframes tl-shimmer {
  from { background-position: 100% 0; }
  to { background-position: -100% 0; }
}

@keyframes tl-hl {
  0% { background-color: var(--tl-accent-soft); }
  30% { background-color: #dde6ee; }
  100% { background-color: var(--tl-accent-soft); }
}

/* ---------- Narrow screens ---------- */

@media (max-width: 720px) {
  .tlive .tl-tabs {
    gap: 12px;
    margin-bottom: 20px;
  }

  .tlive .tl-tab {
    flex-direction: column;
    gap: 2px;
    padding-top: 12px;
    font-size: 13px;
  }

  .tlive .tl-win {
    border-radius: 8px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .tlive *,
  .tlive *::before,
  .tlive *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .tlive .tl-scene {
    animation: tl-fade 0.6s ease both !important;
  }

  .tlive .tl-spin {
    animation: none !important;
  }
}
