/* Стили рабочего пространства ИИ-помощника преподавателя (/teacher-agent и вкладка в /tutor). */

.shell:has(#ta-workspace) {
  height: 100vh;
  height: 100dvh;
  min-height: 0;
  overflow: hidden;
}

.main:has(#ta-workspace) {
  padding: 0;
  height: 100vh;
  height: 100dvh;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: padding-left .28s cubic-bezier(.22, 1, .36, 1);
}

@media (min-width: 900px) {
  body.is-side-collapsed .main:has(#ta-workspace) {
    padding-left: 0;
  }
}

.main:has(#ta-workspace) > .page {
  max-width: none;
  width: 100%;
  height: 100%;
  min-height: 0;
  margin: 0;
  gap: 0;
  display: flex;
  flex-direction: column;
}

body:has(#ta-workspace) .mini-chat-dock {
  display: none !important;
}

.ta-shell {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  max-width: 960px;
  min-height: calc(100dvh - 84px);
  box-sizing: border-box;
  margin: 0 auto;
  padding: 12px 16px 16px;
  color: var(--ink);
  min-width: 0;
}

#ta-workspace.ta-shell {
  flex: 1 1 auto;
  height: 100%;
  min-height: 0;
}

#ta-workspace .ta-chat-log {
  flex: 1 1 auto;
  min-height: 0;
  max-height: none;
  overflow-y: auto;
}

#ta-workspace .ta-ag-composer-wrap {
  flex: none;
  margin-top: auto;
}

#ta-workspace .ta-work-drawer,
#ta-workspace .ta-stand-bar {
  max-height: 44dvh;
  overflow-y: auto;
}

.ta-mode-seg {
  width: 100%;
  min-width: 0;
  flex: none;
}

.ta-session-bar {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
  padding: 2px 0;
}

.ta-session-wrap {
  position: relative;
  min-width: 0;
  flex: 1 1 auto;
  display: flex;
  align-items: center;
}

.ta-session-trigger {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  max-width: 100%;
  height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s, border-color .15s;
}

.ta-session-trigger:hover,
.ta-session-trigger.is-open {
  background: var(--surface-2);
  border-color: var(--line-strong, var(--line));
}

.ta-session-trigger svg {
  flex: none;
  color: var(--muted);
}

.ta-session-trigger-title {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ta-session-count {
  flex: none;
  font-size: 11px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--muted);
}

.ta-session-bar-right {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: none;
}

.ta-session-badge {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  background: var(--surface-2);
  color: var(--muted);
  white-space: nowrap;
}

.ta-session-badge.is-warn {
  background: var(--warn-soft, color-mix(in srgb, var(--warn) 14%, transparent));
  color: var(--warn);
}

.ta-session-new-btn {
  display: inline-flex;
  align-items: center;
  height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--accent) 30%, var(--line));
  background: var(--accent-soft);
  color: var(--accent);
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: opacity .15s, transform .12s;
}

.ta-session-new-btn:hover {
  opacity: .9;
}

.ta-session-popover {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  width: min(360px, calc(100vw - 32px));
  padding: 8px;
  border-radius: 16px;
  background: color-mix(in srgb, var(--surface) 96%, transparent);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid var(--line-strong, var(--line));
  box-shadow: 0 12px 36px rgba(15, 23, 42, .18);
  z-index: 40;
  box-sizing: border-box;
}

.ta-session-list {
  display: grid;
  gap: 4px;
  max-height: 280px;
  overflow-y: auto;
}

.ta-session-row {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 2px;
  border-radius: 10px;
  transition: background .14s;
}

.ta-session-row:hover {
  background: var(--surface-2);
}

.ta-session-row.is-active {
  background: var(--accent-soft);
}

.ta-session-item {
  flex: 1 1 auto;
  min-width: 0;
  display: grid;
  gap: 2px;
  text-align: left;
  padding: 6px 8px;
  border: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  cursor: pointer;
}

.ta-session-item-title {
  font-size: 12.5px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ta-session-item-meta {
  font-size: 11px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ta-session-del {
  flex: none;
  width: 26px;
  height: 26px;
  border-radius: 8px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
  display: inline-grid;
  place-items: center;
}

.ta-session-del:hover {
  background: var(--bad-soft);
  color: var(--bad);
}

.ta-welcome-sub {
  font-size: 12.5px;
  color: var(--muted);
  text-align: center;
  max-width: 340px;
}

.ta-open-chat {
  position: relative;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
  min-height: 0;
  background: transparent;
  border: 0;
  padding: 0;
  box-shadow: none;
}

.ta-work-tools-bar {
  display: flex;
  flex-wrap: nowrap;
  overflow-x: auto;
  gap: 6px;
  padding-bottom: 2px;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  flex: none;
}

.ta-work-tools-bar::-webkit-scrollbar {
  display: none;
}

.ta-work-tools-bar .chip-btn {
  flex: 0 0 auto;
  white-space: nowrap;
}

.ta-work-drawer {
  flex: none;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}

.ta-head-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex: 1 1 260px;
}

.ta-brand-mark {
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: var(--accent-soft);
  color: var(--accent);
}

.ta-head-title {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.ta-head-title h1 {
  margin: 0;
  font-size: clamp(17px, 2vw, 21px);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.015em;
}

.ta-head-sub {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  line-height: 1.3;
  color: var(--muted);
  min-width: 0;
}

.ta-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  flex: 0 0 8px;
  background: var(--muted);
}

.ta-status-dot.is-ok {
  background: var(--confirm);
  box-shadow: 0 0 0 3px var(--confirm-soft);
}

.ta-status-dot.is-local {
  background: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.ta-head-acts {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.ta-head-acts .btn.is-active {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: transparent;
}

.ta-scope-seg {
  display: inline-flex;
  padding: 3px;
  border-radius: 10px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  gap: 2px;
}

.ta-scope-seg button {
  padding: 4px 10px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.ta-scope-seg button.is-on {
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 1px 2px rgba(15, 23, 42, .08);
}

.ta-row-wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.ta-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  background: var(--surface-2);
  color: var(--ink-2);
  border: 1px solid var(--line);
}

.ta-pill.is-accent {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: transparent;
}

.ta-pill.is-ok {
  background: var(--confirm-soft);
  color: var(--confirm);
  border-color: transparent;
}

.ta-pill.is-warn {
  background: var(--notif-soft);
  color: var(--notif);
  border-color: transparent;
}

.ta-pill.is-bad {
  background: var(--bad-soft);
  color: var(--bad);
  border-color: transparent;
}

.ta-stand-bar {
  display: grid;
  gap: 10px;
  padding: 12px 16px;
  border-radius: 16px;
  background: var(--surface);
  border: 1px dashed var(--line-strong);
}

.ta-stand-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.ta-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

.ta-panel {
  display: grid;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  min-width: 0;
}

.ta-panel-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.ta-panel-label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--muted);
}

.ta-prompts {
  display: flex;
  flex-wrap: nowrap;
  overflow-x: auto;
  gap: 6px;
  padding-bottom: 2px;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.ta-prompts::-webkit-scrollbar,
.ta-tabs::-webkit-scrollbar {
  display: none;
}

.ta-prompt-chip {
  flex: 0 0 auto;
  white-space: nowrap;
  padding: 6px 11px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--ink-2);
  font: inherit;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: background .16s, border-color .16s, color .16s;
}

.ta-prompt-chip:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
}

.ta-chat-log {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 200px;
  min-width: 0;
  max-width: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 6px 2px;
}

.ta-welcome {
  position: relative;
  margin: auto 0;
  padding: 24px 16px;
  display: grid;
  justify-items: center;
  text-align: center;
  gap: 12px;
}

.ta-welcome::before {
  content: "";
  position: absolute;
  width: 220px;
  height: 140px;
  border-radius: 999px;
  background: radial-gradient(circle, color-mix(in srgb, var(--accent) 14%, transparent) 0%, color-mix(in srgb, var(--pro) 8%, transparent) 55%, transparent 75%);
  filter: blur(18px);
  pointer-events: none;
  z-index: 0;
}

#ta-workspace[data-mode="work"] .ta-welcome::before {
  background: radial-gradient(circle, color-mix(in srgb, var(--pro) 16%, transparent) 0%, color-mix(in srgb, var(--accent) 9%, transparent) 55%, transparent 75%);
}

.ta-welcome > * {
  position: relative;
  z-index: 1;
}

.ta-welcome b {
  font-size: clamp(16px, 2.2vw, 18.5px);
  font-weight: 600;
  letter-spacing: -0.015em;
  color: var(--ink);
}

.ta-welcome-ico {
  width: 46px;
  height: 46px;
  border-radius: 15px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 16%, var(--surface)), color-mix(in srgb, var(--pro) 14%, var(--surface)));
  border: 1px solid color-mix(in srgb, var(--accent) 24%, var(--line));
  box-shadow: 0 8px 24px color-mix(in srgb, var(--accent) 14%, transparent), inset 0 1px 0 color-mix(in srgb, var(--surface) 80%, transparent);
  color: var(--accent);
  transition: color .2s, border-color .2s, box-shadow .2s;
}

#ta-workspace[data-mode="work"] .ta-welcome-ico {
  color: var(--pro);
  border-color: color-mix(in srgb, var(--pro) 28%, var(--line));
  box-shadow: 0 8px 24px color-mix(in srgb, var(--pro) 16%, transparent), inset 0 1px 0 color-mix(in srgb, var(--surface) 80%, transparent);
}

.ta-msg {
  box-sizing: border-box;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
  max-width: 92%;
  min-width: 0;
  padding: 12px 16px;
  font-size: 13.5px;
  line-height: 1.5;
}

.ta-user-turn {
  align-self: flex-end;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  max-width: 78%;
  gap: 4px;
}

.ta-user-turn .ta-msg.is-user {
  align-self: stretch;
  max-width: 100%;
}

.ta-msg.is-user {
  align-self: flex-end;
  max-width: 78%;
  border-radius: 18px 18px 4px 18px;
  background: var(--accent);
  color: var(--accent-ink);
  border: none;
  padding: 10px 15px;
}

.ta-user-msg-bar {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding-right: 4px;
  font-size: 11.5px;
  color: var(--muted);
  opacity: 0;
  pointer-events: none;
  transform: translateY(-2px);
  transition: opacity .15s ease, transform .15s ease;
}

.ta-user-turn:hover .ta-user-msg-bar,
.ta-user-turn:focus-within .ta-user-msg-bar {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

@media (hover: none) {
  .ta-user-msg-bar {
    opacity: .72;
    pointer-events: auto;
    transform: none;
  }
}

.ta-user-msg-time {
  margin-right: 4px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.ta-user-act-btn {
  position: relative;
  appearance: none;
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: background .12s, color .12s;
}

.ta-user-act-btn:hover {
  background: var(--surface-2);
  color: var(--ink);
}

.ta-user-act-btn.is-copied {
  color: var(--ok, #16a34a);
}

.ta-user-act-btn:hover .ta-btn-tip,
.ta-user-act-btn:focus-visible .ta-btn-tip {
  opacity: 1;
  transform: translateY(0);
}

.ta-msg.is-assistant {
  align-self: flex-start;
  width: 100%;
  max-width: 100%;
  border-radius: 16px;
  background: var(--surface-2);
  border: 1px solid var(--line);
}

.ta-msg-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 11.5px;
  color: var(--muted);
}

.ta-msg-who {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-weight: 700;
  color: var(--ink-2);
}

.ta-msg-who svg {
  width: 13px;
  height: 13px;
  color: var(--accent);
}

.ta-trace-id {
  font-size: 11px;
  color: var(--muted);
  opacity: .85;
}

.ta-msg-body {
  white-space: pre-wrap;
  word-break: break-word;
  overflow-wrap: anywhere;
  min-width: 0;
  max-width: 100%;
}

.ta-msg-body.is-md {
  white-space: normal;
  line-height: 1.5;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 6px;
  min-width: 0;
  max-width: 100%;
}

.ta-msg-body.is-md .crs-p,
.ta-msg-body.is-md ul.theory,
.ta-msg-body.is-md ol.crs-md-ol,
.ta-msg-body.is-md .crs-md-quote,
.ta-msg-body.is-md .crs-md-h,
.ta-msg-body.is-md .cb-md-codeblock,
.ta-msg-body.is-md .qtbl-wrap {
  margin: 0;
}

.ta-msg-body.is-md .crs-md-fold-btn {
  display: none;
}

.ta-msg-body.is-md .crs-md-h {
  font-weight: 700;
  line-height: 1.35;
}

.ta-msg-body.is-md .crs-md-h.is-h1 { font-size: 16px; }
.ta-msg-body.is-md .crs-md-h.is-h2 { font-size: 15px; }
.ta-msg-body.is-md .crs-md-h.is-h3,
.ta-msg-body.is-md .crs-md-h.is-h4 { font-size: 14px; }
.ta-msg-body.is-md .crs-md-h.is-h5,
.ta-msg-body.is-md .crs-md-h.is-h6 { font-size: 13.5px; }

.ta-msg-body.is-md ul.theory,
.ta-msg-body.is-md ol.crs-md-ol {
  display: grid;
  gap: 4px;
}

.ta-msg-body.is-md ul.theory {
  list-style: none;
  padding-left: 0;
}

.ta-msg-body.is-md ul.theory li {
  color: inherit;
  max-width: none;
}

.ta-msg-body.is-md ol.crs-md-ol {
  list-style: decimal;
  padding-left: 20px;
}

.ta-msg-body.is-md code {
  padding: 1px 5px;
  border-radius: 5px;
  font-size: 12.5px;
  background: var(--surface-2, rgba(15, 23, 42, .06));
}

.ta-msg-body.is-md .cb-md-codeblock code {
  padding: 0;
  background: transparent;
}

.ta-msg-body.is-md .cb-md-codeblock,
.ta-msg-body.is-md .qtbl-wrap {
  max-width: 100%;
  overflow-x: auto;
}

.ta-msg-body.is-md .crs-md-link {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
  word-break: break-all;
}

.ta-msg-body.is-md .crs-md-hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 4px 0;
}

.ta-msg-body.is-md .crs-md-quote {
  padding: 6px 10px;
  border-left: 3px solid var(--accent);
  background: var(--surface-2, rgba(15, 23, 42, .04));
  border-radius: 0 8px 8px 0;
}

.ta-msg-tags,
.ta-msg-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding-top: 2px;
}

.ta-chat-form {
  display: grid;
  gap: 6px;
  padding: 10px 12px;
  border-radius: 16px;
  background: var(--bg);
  border: 1px solid var(--line-strong, var(--line));
  transition: border-color .16s, box-shadow .16s;
}

.ta-chat-form:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.ta-composer-input {
  width: 100%;
  box-sizing: border-box;
  border: 0;
  padding: 2px 0;
  resize: none;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 14px;
  line-height: 1.42;
}

.ta-composer-input:focus {
  outline: none;
}

.ta-textarea,
.ta-input,
.ta-select {
  width: 100%;
  box-sizing: border-box;
  padding: 9px 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--ink);
  font: inherit;
  font-size: 13.5px;
}

.ta-textarea:focus,
.ta-input:focus,
.ta-select:focus {
  outline: 2px solid color-mix(in srgb, var(--accent) 32%, transparent);
  border-color: var(--accent);
}

.ta-chat-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.ta-attach-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 30px;
  padding: 0 10px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-2);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.ta-attach-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.ta-ag-composer-wrap {
  position: relative;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.ta-top-row {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-width: 0;
}

.ta-top-row .ta-mode-seg {
  flex: 1 1 auto;
  width: auto;
  min-width: 0;
}

.ta-back-cab-btn {
  flex: none;
  white-space: nowrap;
  padding: 6px 10px;
}

.ta-ag-composer {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  padding: 11px 13px 9px;
  border: 1px solid var(--line-strong, var(--line));
  border-radius: 18px;
  background: var(--surface);
  box-shadow: 0 2px 10px rgba(15, 23, 42, .05);
  transition: border-color .16s, box-shadow .16s;
}

.ta-ag-composer:focus-within {
  border-color: color-mix(in srgb, var(--accent) 55%, var(--line-strong, var(--line)));
  box-shadow: 0 0 0 3px var(--accent-soft), 0 4px 18px rgba(15, 23, 42, .06);
}

.ta-ag-files-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.ta-ag-thumb-item {
  position: relative;
  width: 44px;
  height: 44px;
  border-radius: 10px;
  border: 1px solid var(--line-strong, var(--line));
  background: var(--surface-2);
  overflow: visible;
  flex: none;
}

.ta-ag-thumb-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 9px;
  display: block;
}

.ta-ag-thumb-ph {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  font-size: 10px;
  color: var(--muted);
}

.ta-ag-thumb-x {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: 12px;
  line-height: 1;
  display: grid;
  place-items: center;
  cursor: pointer;
  padding: 0;
}

.ta-msg-thumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.ta-msg-thumb {
  width: 56px;
  height: 56px;
  border-radius: 10px;
  object-fit: cover;
  border: 1px solid color-mix(in srgb, var(--surface) 35%, transparent);
}

.ta-input-stage {
  position: relative;
  display: block;
  width: 100%;
  min-width: 0;
}

.ta-input-stage.has-interim {
  display: grid;
  max-height: 240px;
  overflow-y: auto;
}

.ta-input-mirror {
  display: none;
  grid-area: 1 / 1;
  box-sizing: border-box;
  min-height: 44px;
  margin: 0;
  padding: 0 2px 2px;
  font: inherit;
  font-size: 14.5px;
  line-height: 1.42;
  color: var(--ink);
  white-space: pre-wrap;
  word-break: break-word;
  overflow-wrap: anywhere;
  pointer-events: none;
}

.ta-input-stage.has-interim .ta-input-mirror {
  display: block;
}

.ta-voice-interim {
  color: var(--muted);
  opacity: .78;
}

.ta-ag-input {
  display: block;
  width: 100%;
  min-height: 44px;
  max-height: 240px;
  box-sizing: border-box;
  margin: 0;
  border: 0;
  padding: 0 2px 2px;
  resize: none;
  overflow-y: hidden;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 14.5px;
  line-height: 1.42;
}

.ta-input-stage.has-interim .ta-ag-input {
  grid-area: 1 / 1;
  min-height: 100%;
  max-height: none;
  overflow: hidden;
  color: transparent;
  -webkit-text-fill-color: transparent;
  caret-color: var(--ink);
}

.ta-input-stage.has-interim .ta-ag-input::placeholder {
  color: transparent !important;
  -webkit-text-fill-color: transparent !important;
  opacity: 0 !important;
}

.ta-ag-input:focus {
  outline: none;
}

.ta-ag-bar {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  min-width: 0;
  width: 100%;
  padding-top: 0;
}

.ta-ag-bar-left {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  container-type: inline-size;
  container-name: ta-bar-left;
}

.ta-ag-bar-right {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 0 0 auto;
}

.ta-ag-perm-anchor {
  position: relative;
  display: inline-flex;
  align-items: center;
  flex: none;
}

.ta-ag-icon-btn {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 999px;
  border: 0;
  background: transparent;
  color: var(--ink-2);
  cursor: pointer;
  flex: none;
  transition: background .15s, color .15s, transform .12s;
}

.ta-ag-icon-btn:hover {
  background: var(--surface-2);
  color: var(--ink);
}

.ta-ag-icon-btn:active {
  transform: scale(.95);
}

.ta-ag-icon-btn.is-listening {
  width: 34px;
  height: 34px;
  background: #e5534b;
  color: #fff;
  box-shadow: 0 2px 8px rgba(229, 83, 75, .28);
}

.ta-ag-icon-btn.is-listening:hover {
  background: #d6453d;
  color: #fff;
}

.ta-ag-icon-btn.is-busy {
  width: 34px;
  height: 34px;
  background: var(--accent-soft);
  color: var(--accent);
}

.ta-mic-eq {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  height: 16px;
}

.ta-mic-eq span {
  display: block;
  width: 3px;
  border-radius: 999px;
  background: currentColor;
  transform-origin: center;
  animation: ta-eq-bar .82s ease-in-out infinite;
}

.ta-mic-eq span:nth-child(1) {
  height: 7px;
  animation-delay: 0s;
}

.ta-mic-eq span:nth-child(2) {
  height: 12px;
  animation-delay: .18s;
}

.ta-mic-eq span:nth-child(3) {
  height: 7px;
  animation-delay: .36s;
}

.ta-mic-eq.is-busy span {
  height: 4px;
  animation: ta-voice-pulse 1s ease-in-out infinite;
}

@keyframes ta-eq-bar {
  0%, 100% { transform: scaleY(.72); }
  50% { transform: scaleY(calc(.95 + var(--ta-mic-lvl, .45) * .45)); }
}

@keyframes ta-voice-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: .45; transform: scale(.82); }
}

.ta-btn-tip {
  position: absolute;
  bottom: calc(100% + 10px);
  right: 50%;
  transform: translate(50%, 4px);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  background: #1a1d24;
  color: #f3f5f8;
  border: 1px solid rgba(255, 255, 255, .1);
  box-shadow: 0 8px 22px rgba(0, 0, 0, .26);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.2;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  z-index: 25;
  transition: opacity .14s ease, transform .14s ease;
}

.ta-btn-tip.is-right {
  right: 0;
  transform: translateY(4px);
}

.ta-btn-tip.is-below {
  top: calc(100% + 6px);
  bottom: auto;
  transform: translate(50%, -4px);
}

.ta-btn-tip.is-below.is-right {
  right: 0;
  transform: translateY(-4px);
}

.ta-btn-tip kbd {
  font: inherit;
  font-size: 11px;
  font-weight: 600;
  color: rgba(243, 245, 248, .68);
}

.ta-ag-icon-btn.is-listening:hover .ta-btn-tip,
.ta-ag-icon-btn.is-listening:focus-visible .ta-btn-tip,
.ta-ag-send-btn.is-voice-send:hover .ta-btn-tip,
.ta-ag-send-btn.is-voice-send:focus-visible .ta-btn-tip {
  opacity: 1;
  transform: translate(50%, 0);
}

.ta-ag-send-btn.is-voice-send:hover .ta-btn-tip.is-right,
.ta-ag-send-btn.is-voice-send:focus-visible .ta-btn-tip.is-right {
  opacity: 1;
  transform: translateY(0);
}

.ta-ag-bar:has(.ta-ag-send-btn.is-voice-send:hover) .ta-ag-icon-btn.is-listening .ta-btn-tip {
  opacity: 0;
}

.ta-cmd-hint {
  display: grid;
  gap: 6px;
  padding: 8px 10px;
  margin-bottom: 8px;
  border-radius: 10px;
  border: 1px solid color-mix(in srgb, var(--accent) 26%, var(--line));
  background: var(--surface-2);
}

.ta-cmd-hint-head {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

.ta-cmd-hint-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 11.5px;
  font-weight: 700;
  flex: none;
}

.ta-cmd-hint-title {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--ink);
  flex: 1 1 auto;
  min-width: 0;
}

.ta-cmd-hint-close {
  appearance: none;
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  flex: none;
  transition: background .12s ease, color .12s ease;
}

.ta-cmd-hint-close:hover {
  background: var(--surface);
  color: var(--ink);
}

.ta-cmd-hint-desc {
  font-size: 12px;
  line-height: 1.4;
  color: var(--ink-2);
}

.ta-cmd-hint-ex {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.ta-cmd-hint-chip {
  appearance: none;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-2);
  border-radius: 999px;
  padding: 2px 9px;
  font: inherit;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color .12s ease, color .12s ease, background-color .12s ease;
}

.ta-cmd-hint-chip:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
}

.ta-msg-head-right {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.ta-msg-act-btn,
.ta-msg-speak-btn {
  position: relative;
  appearance: none;
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  padding: 0;
  border-radius: 7px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: background .14s, color .14s, border-color .14s;
}

.ta-msg-act-btn:hover,
.ta-msg-speak-btn:hover {
  background: var(--surface);
  border-color: var(--line);
  color: var(--ink);
}

.ta-msg-act-btn.is-copied {
  color: var(--ok, #16a34a);
}

.ta-msg-act-btn:hover .ta-btn-tip,
.ta-msg-act-btn:focus-visible .ta-btn-tip,
.ta-msg-speak-btn:hover .ta-btn-tip,
.ta-msg-speak-btn:focus-visible .ta-btn-tip {
  opacity: 1;
  transform: translateY(0);
}

.ta-msg-speak-btn.is-speaking {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
}

.ta-ag-model-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 30px;
  padding: 0 7px;
  border-radius: 999px;
  border: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  transition: background .16s;
}

.ta-ag-model-btn b {
  font-weight: 600;
  flex: 0 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ta-ag-model-btn svg {
  flex: none;
}

.ta-ag-model-btn svg:last-child,
.ta-ag-mode-btn svg:last-child {
  transition: transform .18s cubic-bezier(.22, 1, .36, 1);
}

.ta-ag-model-btn.is-open svg:last-child,
.ta-ag-mode-btn.is-open svg:last-child {
  transform: rotate(180deg);
}

.ta-ag-model-sub {
  color: var(--muted);
  font-weight: 500;
  flex: 0 0 auto;
  white-space: nowrap;
}

@container ta-bar-left (max-width: 340px) {
  .ta-ag-model-sub {
    display: none;
  }
}

@container ta-bar-left (max-width: 260px) {
  .ta-dsh-pill {
    display: none;
  }
}

@media (max-width: 640px) {
  .ta-ag-model-sub {
    display: none;
  }
}

@media (max-width: 480px) {
  .ta-ag-bar-left .ta-dsh-pill {
    display: none;
  }
}

.ta-ag-model-btn:hover,
.ta-ag-model-btn.is-open {
  background: var(--surface-2);
}

.ta-model-dot {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  flex: none;
}

.ta-model-dot.is-gigachat3 {
  background: var(--confirm);
  box-shadow: 0 0 0 2px var(--confirm-soft);
}

.ta-model-dot.is-gemini4-neon {
  background: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-soft);
}

.ta-model-dot.is-orchestrator {
  background: var(--pro);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--pro) 18%, transparent);
}

.ta-model-dot.is-deepseek-harness {
  background: var(--confirm);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--confirm) 20%, transparent);
}

.ta-model-dot.is-emerald {
  background: var(--confirm);
  box-shadow: 0 0 0 2px var(--confirm-soft);
}

.ta-model-dot.is-blue {
  background: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-soft);
}

.ta-model-dot.is-amber {
  background: var(--warn);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--warn) 22%, transparent);
}

.ta-model-dot.is-violet {
  background: var(--pro);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--pro) 18%, transparent);
}

.ta-dsh-pill {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--confirm) 12%, transparent);
  color: var(--confirm);
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

.ta-dsh-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
  font-size: 11.5px;
  color: var(--muted);
}

.ta-stream-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.ta-stream-dots {
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.ta-stream-dots span {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
  opacity: .35;
  animation: ta-stream-pulse 1.1s ease-in-out infinite;
}

.ta-stream-dots span:nth-child(2) { animation-delay: .18s; }
.ta-stream-dots span:nth-child(3) { animation-delay: .36s; }

.ta-stream-caret {
  display: inline-block;
  width: 2px;
  height: 1em;
  margin-left: 2px;
  vertical-align: -0.14em;
  border-radius: 1px;
  background: var(--accent, currentColor);
  animation: ta-stream-blink .85s steps(2, start) infinite;
}

@keyframes ta-stream-pulse {
  0%, 80%, 100% { opacity: .28; transform: translateY(0); }
  40% { opacity: .95; transform: translateY(-1px); }
}

@keyframes ta-stream-blink {
  0%, 49% { opacity: 1; }
  50%, 100% { opacity: .15; }
}

@media (prefers-reduced-motion: reduce) {
  .ta-stream-dots span,
  .ta-stream-caret,
  .ta-tr-progress::after,
  .ta-tr-step-dot,
  .ta-tr-chk-ico.is-busy i {
    animation: none;
  }
}

/* ---------- умная панель шагов, live-diff и чеклист ---------- */
.ta-tr-panel {
  position: relative;
  margin-bottom: 10px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface-2) 64%, var(--surface));
  overflow: hidden;
}
:root[data-theme="dark"] .ta-tr-panel {
  background: #0c0e13;
  border-color: #242834;
}
.ta-tr-head {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border: 0;
  background: transparent;
  color: var(--ink-2);
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  transition: background-color .14s ease, color .14s ease;
}
.ta-tr-head:hover {
  background: color-mix(in srgb, var(--surface-2) 70%, transparent);
  color: var(--ink);
}
.ta-tr-head-title {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ta-tr-count,
.ta-tr-time {
  flex: none;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
}
.ta-tr-chev {
  flex: none;
  color: var(--muted);
  transition: transform .18s ease;
}
.ta-tr-panel.is-open .ta-tr-head > .ta-tr-chev {
  transform: rotate(90deg);
}
.ta-tr-progress {
  position: relative;
  height: 2px;
  width: 100%;
  background: color-mix(in srgb, var(--accent) 18%, transparent);
  overflow: hidden;
}
.ta-tr-progress::after {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 38%;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  animation: ta-tr-sweep 1.35s ease-in-out infinite;
}
@keyframes ta-tr-sweep {
  0% { transform: translateX(-110%); }
  100% { transform: translateX(320%); }
}
.ta-tr-steps {
  display: grid;
  gap: 6px;
  padding: 8px 12px 10px;
  border-top: 1px solid color-mix(in srgb, var(--line) 75%, transparent);
}
.ta-tr-step {
  display: grid;
  gap: 5px;
}
.ta-tr-step-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  line-height: 1.4;
  color: var(--muted);
  min-width: 0;
}
.ta-tr-step.is-running .ta-tr-step-row {
  padding: 4px 8px;
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface-2) 85%, transparent);
  color: var(--ink-2);
}
.ta-tr-step.is-error .ta-tr-step-row {
  color: var(--bad);
}
.ta-tr-verb {
  font-weight: 500;
  color: var(--ink-2);
  flex: none;
}
.ta-tr-lang {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 17px;
  padding: 0 4px;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: -.02em;
  flex: none;
  background: color-mix(in srgb, var(--muted) 16%, transparent);
  color: var(--ink-2);
}
.ta-tr-lang.is-css { color: #38bdf8; background: color-mix(in srgb, #38bdf8 14%, transparent); }
.ta-tr-lang.is-js { color: #f59e0b; background: color-mix(in srgb, #f59e0b 15%, transparent); }
.ta-tr-lang.is-ts { color: #3b82f6; background: color-mix(in srgb, #3b82f6 15%, transparent); }
.ta-tr-lang.is-py { color: #60a5fa; background: color-mix(in srgb, #60a5fa 15%, transparent); }
.ta-tr-lang.is-sql { color: #a78bfa; background: color-mix(in srgb, #a78bfa 16%, transparent); }
.ta-tr-lang.is-md { color: var(--ink-2); background: color-mix(in srgb, var(--muted) 18%, transparent); }
.ta-tr-lang.is-json { color: #22c55e; background: color-mix(in srgb, #22c55e 14%, transparent); }
.ta-tr-lang.is-html { color: #fb923c; background: color-mix(in srgb, #fb923c 15%, transparent); }
.ta-tr-lang.is-pptx { color: #f43f5e; background: color-mix(in srgb, #f43f5e 15%, transparent); }
.ta-tr-target {
  color: var(--ink);
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: min(320px, 60vw);
}
.ta-tr-lines {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--muted);
  flex: none;
}
.ta-tr-sum {
  font-size: 11.5px;
  color: var(--muted);
}
.ta-tr-diff-stat {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  flex: none;
}
.ta-tr-diff-stat .is-add { color: var(--confirm); }
.ta-tr-diff-stat .is-del { color: var(--bad); }
.ta-tr-step-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  animation: ta-stream-pulse 1s ease-in-out infinite;
  flex: none;
}
.ta-tr-diff-btn {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 7px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  font: inherit;
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  flex: none;
  transition: color .14s ease, border-color .14s ease;
}
.ta-tr-diff-btn:hover {
  color: var(--ink);
  border-color: var(--line-strong);
}
.ta-tr-diff-btn[aria-expanded="true"] .ta-tr-chev {
  transform: rotate(90deg);
}
.ta-tr-diff-box {
  border-radius: 9px;
  border: 1px solid var(--line);
  background: var(--surface);
  font-family: var(--font-mono);
  font-size: 11.5px;
  line-height: 1.48;
  max-height: 210px;
  overflow: auto;
  padding: 4px 0;
}
:root[data-theme="dark"] .ta-tr-diff-box {
  background: #05070a;
  border-color: #212530;
}
.ta-tr-diff-line {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  padding: 1px 10px 1px 6px;
  white-space: pre-wrap;
  word-break: break-word;
}
.ta-tr-diff-line.is-add {
  background: color-mix(in srgb, #22c55e 14%, transparent);
  color: #15803d;
}
:root[data-theme="dark"] .ta-tr-diff-line.is-add {
  background: color-mix(in srgb, #22c55e 16%, transparent);
  color: #86efac;
}
.ta-tr-diff-line.is-del {
  background: color-mix(in srgb, #ff4d5e 13%, transparent);
  color: #be123c;
}
:root[data-theme="dark"] .ta-tr-diff-line.is-del {
  background: color-mix(in srgb, #ff4d5e 16%, transparent);
  color: #fda4af;
}
.ta-tr-diff-line.is-hunk {
  color: var(--muted);
  background: color-mix(in srgb, var(--surface-2) 60%, transparent);
}
.ta-tr-diff-line.is-ctx {
  color: var(--ink-2);
}
.ta-tr-diff-sig {
  user-select: none;
  opacity: .78;
}
.ta-tr-checklist {
  display: grid;
  gap: 6px;
  padding: 8px 12px 10px;
  border-top: 1px solid color-mix(in srgb, var(--line) 75%, transparent);
  background: color-mix(in srgb, var(--surface) 55%, transparent);
}
.ta-tr-chk-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  line-height: 1.35;
  color: var(--muted);
}
.ta-tr-chk-item.is-busy {
  color: var(--ink);
  font-weight: 500;
}
.ta-tr-chk-item.is-done {
  color: var(--muted);
}
.ta-tr-chk-item.is-err {
  color: var(--bad);
}
.ta-tr-chk-ico {
  width: 14px;
  height: 14px;
  flex: none;
  display: inline-grid;
  place-items: center;
}
.ta-tr-chk-ico.is-done { color: var(--muted); }
.ta-tr-chk-ico.is-pend { color: var(--muted); opacity: .7; }
.ta-tr-chk-ico.is-err { color: var(--bad); }
.ta-tr-chk-ico.is-busy {
  grid-template-columns: repeat(2, 4px);
  gap: 2px;
  padding: 2px;
}
.ta-tr-chk-ico.is-busy i {
  display: block;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--ink);
  animation: ta-stream-pulse 1s ease-in-out infinite;
}
.ta-tr-chk-ico.is-busy i:nth-child(2) { animation-delay: .15s; }
.ta-tr-chk-ico.is-busy i:nth-child(3) { animation-delay: .30s; }
.ta-tr-chk-ico.is-busy i:nth-child(4) { animation-delay: .45s; }
.ta-tr-stream-answer {
  margin-top: 4px;
}

.ta-ag-mode-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 30px;
  padding: 0 7px;
  border-radius: 999px;
  border: 0;
  background: transparent;
  color: var(--ink-2);
  font: inherit;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  flex: none;
  white-space: nowrap;
  transition: background .15s, color .15s;
}

.ta-ag-mode-btn:hover,
.ta-ag-mode-btn.is-open {
  background: var(--surface-2);
  color: var(--ink);
}

.ta-ag-mode-btn.is-turbo {
  color: var(--ink);
}

.ta-ag-mode-btn.is-local {
  background: var(--accent-soft);
  color: var(--accent);
}

.ta-ag-send-btn {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  border: 0;
  background: var(--accent);
  color: var(--accent-ink);
  cursor: pointer;
  flex: none;
  transition: opacity .15s, transform .12s;
}

.ta-ag-send-btn:hover:not(:disabled) {
  opacity: .92;
  transform: translateY(-1px);
}

.ta-ag-send-btn:active:not(:disabled) {
  transform: scale(.95);
}

.ta-ag-send-btn:disabled {
  opacity: .55;
  cursor: default;
}

.ta-model-popover {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 32px;
  width: min(392px, calc(100% - 16px));
  max-height: min(74dvh, 540px);
  display: flex;
  flex-direction: column;
  padding: 6px;
  border-radius: 14px;
  background: var(--surface);
  border: 1px solid var(--line-strong, var(--line));
  box-shadow: 0 12px 36px rgba(15, 23, 42, .16), 0 2px 8px rgba(15, 23, 42, .06);
  z-index: 35;
  overflow: hidden;
  box-sizing: border-box;
  transform-origin: bottom left;
}

@keyframes ta-pop-enter {
  from { opacity: 0; transform: translateY(8px) scale(.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.ta-model-popover.is-pop-enter,
.ta-perm-popover.is-pop-enter {
  animation: ta-pop-enter .18s cubic-bezier(.16, 1, .3, 1) both;
}

.ta-pop-view {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-height: 0;
  overflow: hidden;
}

@keyframes ta-slide-in-right {
  from { opacity: 0; transform: translateX(26px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes ta-slide-in-left {
  from { opacity: 0; transform: translateX(-22px); }
  to { opacity: 1; transform: translateX(0); }
}

.ta-pop-view.is-slide-fwd {
  animation: ta-slide-in-right .2s cubic-bezier(.22, 1, .36, 1) both;
}

.ta-pop-view.is-slide-back {
  animation: ta-slide-in-left .18s cubic-bezier(.22, 1, .36, 1) both;
}

.ta-subpop-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  padding: 2px 6px 4px;
}

.ta-subpop-back {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  padding: 3px 6px 3px 2px;
  border-radius: 8px;
  cursor: pointer;
}

.ta-subpop-back:hover {
  background: var(--surface-2);
}

.ta-subpop-ctx {
  font-size: 11.5px;
  color: var(--muted);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ta-subpop-acts {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: none;
}

.ta-subpop-compact {
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--ink-2);
  font: inherit;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  padding: 2px 8px;
  border-radius: 6px;
  transition: background .14s, color .14s, border-color .14s;
}

.ta-subpop-compact:hover:not(:disabled) {
  background: var(--surface);
  border-color: var(--line-strong, var(--line));
  color: var(--ink);
}

.ta-subpop-compact:disabled {
  opacity: .48;
  cursor: default;
}

.ta-subpop-refresh {
  border: 0;
  background: transparent;
  color: var(--accent);
  font: inherit;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 6px;
}

.ta-subpop-refresh:hover {
  background: var(--accent-soft);
}

.ta-model-sec-title {
  padding: 4px 8px 2px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--muted);
}

.ta-model-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.ta-model-popover .ta-model-list {
  max-height: min(300px, 40dvh);
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 2px;
  overscroll-behavior: contain;
}

.ta-model-opt,
.ta-model-usage-btn,
.ta-thinking-opt {
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex: 0 0 auto;
  width: 100%;
  height: auto;
  min-height: 34px;
  padding: 6px 10px;
  border-radius: 8px;
  border: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 13px;
  line-height: 1.25;
  text-align: left;
  cursor: pointer;
  overflow: hidden;
  transition: background .14s, color .14s;
}

.ta-model-opt:hover,
.ta-model-usage-btn:hover,
.ta-thinking-opt:hover {
  background: var(--surface-2);
}

.ta-model-opt.is-active,
.ta-model-usage-btn.is-active,
.ta-thinking-opt.is-active {
  background: var(--accent-soft);
}

.ta-thinking-opt.is-active {
  font-weight: 600;
}

.ta-model-opt-main {
  display: flex;
  align-items: center;
  gap: 7px;
  flex: 1 1 auto;
  min-width: 0;
  flex-wrap: nowrap;
  overflow: hidden;
}

.ta-model-opt-main b {
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 0 1 auto;
  min-width: 0;
}

.ta-model-opt-sub {
  font-size: 12px;
  color: var(--muted);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 0 10 auto;
  min-width: 0;
}

.ta-model-opt.is-locked {
  color: var(--muted);
}

.ta-model-opt.is-locked .ta-model-dot {
  background: var(--muted);
  opacity: .45;
  box-shadow: none;
}

.ta-model-opt.is-locked b {
  color: var(--muted);
  font-weight: 500;
}

.ta-model-opt.is-locked .ta-model-opt-sub {
  color: var(--muted);
  opacity: .72;
}

.ta-model-lock-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  background: var(--surface-2);
  color: var(--muted);
  border: 1px solid var(--line);
  white-space: nowrap;
  flex: 0 0 auto;
}

.ta-model-opt.is-locked:hover .ta-model-lock-pill {
  border-color: var(--line-strong, var(--line));
  color: var(--ink-2);
}

.ta-model-badge {
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  background: var(--surface-2);
  color: var(--ink-2);
  border: 1px solid var(--line);
  white-space: nowrap;
}

.ta-model-opt.is-active .ta-model-badge {
  background: var(--surface);
  color: var(--accent);
}

.ta-model-badge.is-free,
.ta-model-opt.is-active .ta-model-badge.is-free {
  background: color-mix(in srgb, var(--confirm) 12%, transparent);
  color: var(--confirm);
  border-color: color-mix(in srgb, var(--confirm) 28%, transparent);
}

.ta-model-opt-right {
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
  white-space: nowrap;
}

.ta-model-sep {
  height: 1px;
  background: var(--line);
  margin: 4px 4px;
}

.ta-thinking-list {
  display: grid;
  gap: 2px;
}

.ta-usage-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 4px 6px;
}

.ta-usage-copy {
  display: grid;
  gap: 1px;
  min-width: 0;
}

.ta-usage-label {
  font-size: 12.5px;
  color: var(--ink-2);
  line-height: 1.3;
}

.ta-usage-sub {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.3;
}

.ta-usage-meter {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  flex: none;
}

.ta-usage-val {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-2);
  white-space: nowrap;
}

.ta-usage-ring {
  transform: rotate(-90deg);
  flex: none;
}

.ta-ring-track {
  fill: none;
  stroke: var(--line-strong, var(--line));
  stroke-width: 2.6;
}

.ta-ring-fill {
  fill: none;
  stroke-width: 2.6;
  stroke-linecap: round;
}

.ta-ring-ok .ta-ring-fill {
  stroke: var(--confirm);
}

.ta-ring-api .ta-ring-fill {
  stroke: var(--accent);
}

@media (max-width: 560px) {
  .ta-shell {
    padding: 10px 12px 14px;
  }
}

.ta-perm-popover {
  position: absolute;
  bottom: calc(100% + 8px);
  right: 0;
  width: min(330px, calc(100vw - 32px));
  padding: 6px;
  border-radius: 14px;
  background: var(--surface);
  border: 1px solid var(--line-strong, var(--line));
  box-shadow: 0 12px 36px rgba(15, 23, 42, .16), 0 2px 8px rgba(15, 23, 42, .06);
  z-index: 35;
  display: grid;
  gap: 2px;
  box-sizing: border-box;
  transform-origin: bottom right;
}

.ta-perm-opt {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 6.5px 10px;
  border-radius: 8px;
  border: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 13px;
  text-align: left;
  cursor: pointer;
  transition: background .14s;
}

.ta-perm-opt:hover {
  background: var(--surface-2);
}

.ta-perm-opt.is-active {
  background: var(--accent-soft);
}

.ta-perm-ico {
  display: inline-grid;
  place-items: center;
  color: var(--muted);
  flex: none;
}

.ta-perm-opt.is-active .ta-perm-ico {
  color: var(--accent);
}

.ta-perm-copy {
  display: grid;
  gap: 2px;
  flex: 1 1 auto;
  min-width: 0;
}

.ta-perm-desc {
  font-size: 11.5px;
  color: var(--muted);
  line-height: 1.3;
}

.ta-x-btn {
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  padding: 0 2px;
  cursor: pointer;
}

.ta-tabs {
  display: flex;
  flex-wrap: nowrap;
  overflow-x: auto;
  gap: 3px;
  padding: 4px;
  border-radius: 12px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

@media (min-width: 961px) {
  .ta-tabs {
    flex-wrap: wrap;
    overflow-x: visible;
  }
}

.ta-tab-btn {
  flex: 0 0 auto;
  white-space: nowrap;
  padding: 6px 9px;
  border-radius: 9px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background .16s, color .16s;
}

.ta-tab-btn[aria-selected="true"] {
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 1px 3px rgba(15, 23, 42, .08);
}

.ta-card {
  display: grid;
  gap: 10px;
  padding: 13px 14px;
  border-radius: 14px;
  background: var(--surface-2);
  border: 1px solid var(--line);
}

.ta-card.is-preview {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent-soft) 55%, var(--surface));
}

.ta-card.is-cancelled {
  opacity: .72;
}

.ta-row-between {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.ta-form-grid {
  display: grid;
  gap: 8px;
}

.ta-two-cols {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.ta-plan-list,
.ta-crit-list,
.ta-steps-list {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.ta-step-item {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 10px;
  background: var(--surface);
  border: 1px solid var(--line);
  font-size: 12.5px;
}

.ta-cal-widget {
  display: grid;
  gap: 10px;
  padding: 14px 16px;
  border-radius: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  margin-top: 12px;
}

.ta-num {
  font-variant-numeric: tabular-nums;
}

.ta-builder-grid {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.ta-course-nav {
  display: grid;
  gap: 8px;
}

.ta-course-item {
  display: grid;
  gap: 4px;
  text-align: left;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
}

.ta-course-item.is-active {
  border-color: var(--accent);
  background: var(--accent-soft, color-mix(in srgb, var(--accent) 10%, transparent));
}

.ta-tpl-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(126px, 1fr));
  gap: 6px;
}

.ta-tpl-chip {
  display: grid;
  gap: 2px;
  text-align: left;
  padding: 7px 9px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--ink);
  font-size: 12px;
  cursor: pointer;
}

.ta-tpl-chip.on {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft, color-mix(in srgb, var(--accent) 12%, transparent));
}

.ta-invite-box {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--bg);
  border: 1px dashed var(--line);
}

.ta-invite-code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--accent);
}

.ta-preview-box {
  padding: 12px;
  border-radius: 12px;
  background: var(--bg);
  border: 1px solid var(--line);
  display: grid;
  gap: 8px;
}

@media (max-width: 960px) {
  .ta-grid,
  .ta-builder-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 899px) {
  .shell:has(#ta-workspace) {
    display: flex;
    flex-direction: column;
    height: 100vh;
    height: 100dvh;
    min-height: 0;
    overflow: hidden;
    padding-top: env(safe-area-inset-top, 0px);
  }
  .shell:has(#ta-workspace) > .topbar {
    position: relative;
    top: auto;
    flex: none;
  }
  .shell:has(#ta-workspace) > .main {
    flex: 1 1 auto;
    height: auto;
    min-height: 0;
    padding: 0;
    overflow: hidden;
  }
  .shell:has(#ta-workspace) > .tabbar {
    position: static;
    flex: none;
    border-top: 1px solid var(--line);
    background: var(--surface);
  }
  .ta-shell {
    padding: 12px;
    padding-bottom: calc(96px + env(safe-area-inset-bottom, 0px));
  }
  #ta-workspace.ta-shell {
    padding: 8px 12px 10px;
    gap: 8px;
    height: 100%;
    min-height: 0;
  }
  #ta-workspace .ta-mode-seg {
    margin: 0;
    width: 100%;
  }
  #ta-workspace .ta-session-badge {
    display: none;
  }
  #ta-workspace .ta-session-popover {
    width: min(320px, calc(100vw - 24px));
  }
  #ta-workspace .ta-chat-log {
    padding: 6px 2px;
  }
  #ta-workspace .ta-work-drawer,
  #ta-workspace .ta-stand-bar {
    margin: 0;
  }
  #ta-workspace .ta-ag-perm-anchor {
    position: static;
  }
  #ta-workspace .ta-model-popover {
    left: 0;
    right: 0;
    width: auto;
  }
  #ta-workspace .ta-perm-popover {
    left: 0;
    right: 0;
    width: auto;
    max-width: none;
  }
  .ta-work-drawer .ta-chat-log {
    min-height: 180px;
    max-height: 34vh;
  }
}

@media (max-width: 560px) {
  .ta-shell {
    padding: 10px;
    padding-bottom: calc(96px + env(safe-area-inset-bottom, 0px));
    gap: 10px;
  }
  #ta-workspace.ta-shell {
    padding: 8px 10px 10px;
    gap: 8px;
  }
  .ta-head {
    padding: 12px;
    border-radius: 16px;
  }
  .ta-panel {
    padding: 12px;
    border-radius: 16px;
  }
  .ta-two-cols {
    grid-template-columns: 1fr;
  }
}

/* Раздел «Общение → Группы»: чат группы, состав студентов и избранное (в единой сетке с .comm-chat-grid). */

.tc-grp-sidebar {
  padding: 0;
  gap: 0;
}

.tc-grp-filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  flex: none;
}

.tc-grp-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 0 0 2px;
  overflow-y: auto;
  flex: 1 1 auto;
  min-height: 0;
}

.tc-grp-stu-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 12px 16px;
  display: grid;
  gap: 10px;
  align-content: start;
}

.tc-grp-stu-list {
  display: grid;
  gap: 8px;
}

.tc-grp-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px 8px 14px;
  min-height: 62px;
  border-radius: 0;
  border: 0;
  background: transparent;
  transition: background-color .14s ease;
}

.tc-grp-item:hover {
  background: var(--surface-2);
}

.tc-grp-item.is-active {
  background: var(--accent-soft);
}

.tc-grp-item-main {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.tc-grp-item-main .avatar {
  flex: none;
  width: 46px;
  height: 46px;
  font-size: 14.5px;
}

.tc-grp-item-txt {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 3px;
  min-width: 0;
  flex: 1 1 auto;
}

.tc-grp-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}

.tc-grp-bottom {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.tc-grp-item-txt b {
  font-size: 14.5px;
  font-weight: 600;
  line-height: 1.25;
}

.tc-fav-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-width: 30px;
  height: 30px;
  padding: 0 8px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  flex-shrink: 0;
  transition: color .16s, border-color .16s, background .16s;
}

.tc-fav-btn.is-inline {
  min-width: 26px;
  height: 26px;
  padding: 0 4px;
  border-color: transparent;
  background: transparent;
}

.tc-fav-btn.is-fav {
  color: var(--notif);
  border-color: color-mix(in srgb, var(--notif) 45%, var(--line));
  background: var(--notif-soft);
}

.tc-fav-btn.is-inline.is-fav {
  border-color: transparent;
  background: transparent;
}

.tc-grp-subtabs {
  flex: none;
  padding: 8px 16px 6px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.tc-grp-pane .mc-messages {
  flex: 1 1 auto;
  min-height: 0;
}

.tc-grp-stu-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--surface-2);
}

.tc-grp-stu-ident {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.tc-venue-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 999px;
  border: 1px dashed var(--line-strong, var(--line));
  background: var(--surface-2);
  color: var(--ink-2);
  font: inherit;
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  transition: border-color .16s, color .16s, background .16s;
}

.tc-venue-btn:hover,
.tc-venue-btn.is-open {
  border-color: var(--accent);
  border-style: solid;
  background: var(--accent-soft);
  color: var(--accent);
}

.tc-venue-editor {
  display: grid;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--surface-2);
  border: 1px solid var(--line);
}

.tc-venue-chips {
  display: flex;
  flex-wrap: nowrap;
  overflow-x: auto;
  gap: 6px;
  padding-bottom: 2px;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.tc-venue-chips::-webkit-scrollbar {
  display: none;
}

.tc-venue-chips .chip-btn {
  flex: 0 0 auto;
  white-space: nowrap;
}

.tc-time-btn {
  display: inline-flex;
  align-items: center;
  font: inherit;
  font-size: 15px;
  padding: 2px 8px;
  margin-left: -8px;
  border-radius: 9px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  transition: border-color .16s, background .16s, color .16s;
}

.tc-time-btn:hover,
.tc-time-btn.is-open {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
}
.study-lesson-card.is-past .tc-time-btn,
.study-lesson-card.is-past .tc-venue-btn {
  color: var(--muted);
}
.study-lesson-card.is-past .tc-past-chat-btn {
  background: var(--surface-2);
  border-color: var(--line);
  color: var(--muted);
}
.study-lesson-card.is-past .tc-past-chat-btn:hover {
  color: var(--ink-2);
  border-color: var(--line-strong, var(--line));
}

@media (max-width: 899px) {
  .tc-grp-sidebar {
    padding: 0;
  }
  .tc-grp-filter-row {
    padding: 8px 12px;
  }
  .tc-grp-subtabs {
    padding: 8px 12px 6px;
  }
  .tc-grp-stu-scroll {
    padding: 10px 12px;
  }
}

/* Подсказка @-команд над полем ввода и компактные карточки @расписание / @задание. */

.ta-mention-popover {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 0;
  width: min(440px, 100%);
  padding: 8px;
  border-radius: 16px;
  background: color-mix(in srgb, var(--surface) 96%, transparent);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid var(--line-strong, var(--line));
  box-shadow: 0 12px 36px rgba(15, 23, 42, .18);
  z-index: 36;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 4px;
  overflow: hidden;
  box-sizing: border-box;
}

.ta-mention-popover .ta-model-list {
  grid-template-columns: minmax(0, 1fr);
  min-width: 0;
}

.ta-mention-opt {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  overflow: hidden;
  padding: 8px 10px;
  border-radius: 10px;
  border: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: background .14s;
}

.ta-mention-opt:hover,
.ta-mention-opt.is-active {
  background: var(--surface-2);
}

.ta-mention-ico {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--muted);
  flex: none;
  display: inline-grid;
  place-items: center;
}

.ta-mention-opt.is-active .ta-mention-ico {
  background: var(--accent-soft);
  border-color: color-mix(in srgb, var(--accent) 24%, transparent);
  color: var(--accent);
}

.ta-mention-copy {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 2px;
  min-width: 0;
  flex: 1 1 auto;
}

.ta-mention-head {
  display: flex;
  align-items: baseline;
  gap: 7px;
  min-width: 0;
}

.ta-mention-copy b {
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  flex: none;
}

.ta-mention-token {
  font-size: 11.5px;
  color: var(--accent);
  font-weight: 600;
  flex: none;
}

.ta-mention-desc {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.3;
  white-space: normal;
}

.ta-rich-sched {
  display: grid;
  gap: 8px;
  padding: 8px;
  border-radius: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
}

.ta-sched-month-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 10px;
  margin-bottom: 8px;
  border-radius: 9px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  font-size: 12px;
  color: var(--muted);
}

.ta-sched-month-head b {
  color: var(--ink);
  font-size: 13px;
}

.ta-sched-weeks {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
}

.ta-sched-weeks.is-dual {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

@media (max-width: 780px) {
  .ta-sched-weeks.is-dual {
    grid-template-columns: minmax(0, 1fr);
  }
}

.ta-sched-week {
  display: grid;
  align-content: start;
  gap: 6px;
  padding: 8px 9px;
  border-radius: 10px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  min-width: 0;
}

.ta-sched-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  flex-wrap: wrap;
  padding-bottom: 5px;
  border-bottom: 1px solid var(--line);
  font-size: 11px;
  color: var(--muted);
}

.ta-sched-head-left {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  min-width: 0;
}

.ta-sched-head b {
  color: var(--ink);
  font-size: 12.5px;
}

.ta-sched-range {
  font-size: 11px;
  color: var(--muted);
}

.ta-sched-day {
  display: grid;
  gap: 3px;
}

.ta-sched-day-title {
  font-size: 11px;
  font-weight: 700;
  line-height: 1.2;
  color: var(--muted);
  text-transform: lowercase;
  padding-left: 2px;
}

.ta-sched-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 7px;
  border-radius: 7px;
  background: var(--surface);
  border-left: 3px solid var(--line);
  font-size: 12px;
  line-height: 1.25;
  min-width: 0;
}

.ta-sched-row.is-uni {
  border-left-color: var(--accent);
}

.ta-sched-row.is-tutor {
  border-left-color: var(--confirm);
}

.ta-sched-time {
  font-size: 11.5px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
  flex: none;
  white-space: nowrap;
}

.ta-sched-main {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ta-sched-tag {
  display: inline-flex;
  align-items: center;
  flex: none;
  padding: 1px 6px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 600;
  white-space: nowrap;
}

.ta-sched-tag.is-uni {
  background: var(--accent-soft);
  color: var(--accent);
}

.ta-sched-tag.is-tutor {
  background: var(--confirm-soft);
  color: var(--confirm);
}

.ta-sched-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink);
}

.ta-sched-meta {
  font-size: 11px;
  color: var(--muted);
}

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

.ta-rag-card.is-req-focused {
  gap: 6px;
  padding: 0;
  border: 0;
  background: transparent;
}

.ta-rag-more {
  display: grid;
  gap: 6px;
}

.ta-rag-more > summary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: fit-content;
  padding: 3px 9px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
  user-select: none;
  transition: color .14s, border-color .14s, background .14s;
}

.ta-rag-more > summary::-webkit-details-marker {
  display: none;
}

.ta-rag-more > summary::before {
  content: "▸";
  font-size: 10px;
  transition: transform .15s ease;
}

.ta-rag-more[open] > summary::before {
  transform: rotate(90deg);
}

.ta-rag-more > summary:hover {
  color: var(--ink);
  border-color: var(--accent);
}

.ta-rag-more > .ta-rag-list {
  margin-top: 2px;
}

.ta-rag-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--line);
  font-size: 11.5px;
  color: var(--muted);
}

.ta-rag-head-left {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.ta-rag-head b {
  color: var(--ink);
  font-size: 12.5px;
}

.ta-rag-badge {
  display: inline-flex;
  align-items: center;
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 600;
  background: var(--accent-soft);
  color: var(--accent);
}

.ta-rag-list {
  display: grid;
  gap: 6px;
}

.ta-rag-row {
  display: grid;
  gap: 2px;
  padding: 7px 9px;
  border-radius: 9px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  min-width: 0;
}

.ta-rag-row-top {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.ta-rag-kind {
  flex: none;
  display: inline-flex;
  align-items: center;
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 700;
  background: var(--accent-soft);
  color: var(--accent);
}

.ta-rag-kind.is-homework,
.ta-rag-kind.is-draft {
  background: var(--warn-soft, rgba(217, 119, 6, .12));
  color: var(--warn, #b45309);
}

.ta-rag-kind.is-schedule,
.ta-rag-kind.is-tutor,
.ta-rag-kind.is-publication {
  background: var(--confirm-soft);
  color: var(--confirm);
}

.ta-rag-kind.is-presentation,
.ta-rag-kind.is-code {
  background: color-mix(in srgb, #7c3aed 12%, transparent);
  color: #6d28d9;
}

.ta-rag-title {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ta-rag-src {
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ta-rag-snip {
  font-size: 12px;
  line-height: 1.35;
  color: var(--ink-2);
}

.ta-rag-go {
  flex: none;
  min-height: 24px;
  height: 24px;
  padding: 0 8px;
  font-size: 11px;
}

.ta-task-choices {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  padding-top: 4px;
}

.ta-task-choices .btn {
  width: 100%;
  min-height: 36px;
  height: auto;
  justify-content: center;
  text-align: center;
  font-size: 12px;
  line-height: 1.2;
  padding: 7px 6px;
  white-space: normal;
}

.ta-task-choices .ta-task-full {
  grid-column: 1 / -1;
}

/* ---------- Workspace 2-column rail: Чаты (chat) и Проекты (work) ---------- */

#ta-workspace.ta-shell {
  max-width: none;
  width: 100%;
  margin: 0;
  padding: 0;
  gap: 0;
}

.ta-session-bar-left {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1 1 auto;
}

.ta-rail-toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  padding: 0 10px;
  border-radius: 8px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  flex: none;
  transition: background .15s, border-color .15s, color .15s;
}

.ta-rail-toggle-btn:hover {
  background: var(--surface-2);
  border-color: var(--line);
}

.ta-rail-toggle-btn svg {
  flex: none;
  color: var(--muted);
}

.ta-rail-toggle-btn:hover svg {
  color: var(--ink);
}

.ta-workspace-body {
  position: relative;
  display: grid;
  grid-template-columns: var(--ta-rail-w, 272px) minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr);
  gap: 0;
  flex: 1 1 auto;
  min-height: 0;
  min-width: 0;
  border: 0;
  border-radius: 0;
  background: var(--surface);
  overflow: visible;
  transition: grid-template-columns .26s cubic-bezier(.22, 1, .36, 1);
}

.ta-workspace-body .ta-open-chat {
  gap: 0;
  border-radius: 0;
  background: var(--surface);
  min-width: 0;
  overflow: hidden;
}

.ta-entity-rail {
  display: flex;
  flex-direction: column;
  gap: 0;
  min-height: 0;
  min-width: 0;
  padding: 0;
  border: 0;
  border-right: 1px solid var(--line);
  border-radius: 0;
  background: var(--bg);
  overflow: hidden;
  transition: transform .26s cubic-bezier(.22, 1, .36, 1), opacity .2s ease, border-color .2s ease;
}

.ta-rail-resizer {
  position: absolute;
  top: 0;
  bottom: 0;
  left: calc(var(--ta-rail-w, 272px) - 4px);
  width: 9px;
  z-index: 25;
  cursor: col-resize;
  touch-action: none;
  transition: opacity .2s ease;
}

.ta-rail-resizer::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 4px;
  width: 2px;
  background: var(--accent);
  opacity: 0;
  transition: opacity .15s ease, width .15s ease, left .15s ease;
}

.ta-rail-resizer:hover::after,
.ta-rail-resizer:focus-visible::after,
.ta-rail-resizer.is-dragging::after {
  opacity: 1;
  width: 3px;
  left: 3px;
  box-shadow: 0 0 8px color-mix(in srgb, var(--accent) 40%, transparent);
}

.ta-rail-resizer:focus-visible {
  outline: none;
}

body.is-ta-rail-resizing {
  user-select: none;
  cursor: col-resize;
}

.ta-workspace-body.is-resizing,
.ta-workspace-body.is-resizing .ta-entity-rail,
.ta-workspace-body.is-resizing .ta-rail-resizer {
  transition: none !important;
}

.ta-workspace-body.is-will-collapse .ta-entity-rail {
  opacity: .45;
}

.ta-rail-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  height: 52px;
  min-height: 52px;
  box-sizing: border-box;
  padding: 0 12px;
  border-bottom: 1px solid var(--line);
  flex: none;
}

.ta-rail-mode-head {
  padding: 8px 12px;
  transition: padding-left .26s cubic-bezier(.22, 1, .36, 1);
}

.ta-rail-mode-head .ta-mode-seg {
  width: 100%;
  padding: 2px;
}

.ta-rail-mode-head .ta-mode-seg button {
  min-height: 30px;
  padding: 4px 8px;
  font-size: 12.5px;
}

.ta-rail-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 2px 2px 0;
  flex: none;
}

#ta-workspace .ta-session-bar-left .ta-mode-seg-inline {
  display: none;
}

.ta-rail-body {
  flex: 1 1 auto;
  min-height: 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px 12px;
  overflow: hidden;
}

.ta-open-chat > .ta-session-bar {
  height: 52px;
  min-height: 52px;
  box-sizing: border-box;
  padding: 0 18px;
  border-bottom: 1px solid var(--line);
  flex: none;
  transition: padding-left .26s cubic-bezier(.22, 1, .36, 1);
}

.ta-open-chat > .ta-session-bar .ta-session-trigger {
  border-color: transparent;
  background: transparent;
  padding: 0 8px;
}

.ta-open-chat > .ta-session-bar .ta-session-trigger:hover,
.ta-open-chat > .ta-session-bar .ta-session-trigger.is-open {
  background: var(--surface-2);
  border-color: var(--line);
}

@media (min-width: 960px) {
  #ta-workspace .ta-mode-seg-mobile {
    display: none !important;
  }
  .ta-workspace-body.is-collapsed {
    grid-template-columns: 0px minmax(0, 1fr);
  }
  .ta-workspace-body.is-collapsed .ta-entity-rail {
    transform: translateX(-100%);
    opacity: 0;
    pointer-events: none;
    border-right-color: transparent;
  }
  .ta-workspace-body.is-collapsed .ta-rail-resizer {
    opacity: 0;
    pointer-events: none;
  }
  #ta-workspace .ta-workspace-body.is-collapsed .ta-session-bar-left .ta-mode-seg-inline {
    display: grid;
    width: auto;
    min-width: 146px;
    flex: none;
    padding: 2px;
  }
  .ta-mode-seg-inline button {
    min-height: 24px;
    padding: 3px 10px;
    font-size: 12px;
  }
  .ta-workspace-body:not(.is-collapsed) .ta-rail-toggle-btn {
    width: 30px;
    padding: 0;
    justify-content: center;
  }
  .ta-workspace-body:not(.is-collapsed) .ta-rail-toggle-label {
    display: none;
  }
  body.is-side-collapsed #ta-workspace .ta-rail-mode-head {
    padding-left: 48px;
  }
  body.is-side-collapsed #ta-workspace .ta-workspace-body.is-collapsed .ta-open-chat > .ta-session-bar {
    padding-left: 48px;
  }
}

.ta-chat-inner {
  flex: 0 0 auto;
  width: 100%;
  max-width: 780px;
  min-width: 0;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-height: 100%;
  box-sizing: border-box;
  overflow-x: clip;
}

.ta-course-pill-row {
  width: 100%;
  max-width: 780px;
  margin: 0 auto;
  padding: 10px 24px 0;
  box-sizing: border-box;
  flex: none;
}

#ta-workspace .ta-workspace-body .ta-chat-log {
  padding: 20px 24px 12px;
}

#ta-workspace .ta-workspace-body .ta-ag-composer-wrap {
  width: 100%;
  max-width: 828px;
  margin: 0 auto;
  padding: 6px 24px 18px;
  box-sizing: border-box;
}

.ta-rail-head-title {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
}

.ta-rail-head-title svg {
  flex: none;
  color: var(--muted);
}

.ta-rail-head-acts {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex: none;
}

.ta-rail-new-btn {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  min-height: 38px;
  padding: 0 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: 13.5px;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  flex: none;
  box-sizing: border-box;
  transition: background-color .15s ease, border-color .15s ease, color .15s ease, transform .1s ease;
}

.ta-rail-new-btn svg {
  width: 15px;
  height: 15px;
  flex: none;
  color: var(--ink-2);
  transition: color .15s ease;
}

.ta-rail-new-btn:hover {
  background: var(--surface-2);
  border-color: var(--line-strong);
}

.ta-rail-new-btn:hover svg {
  color: var(--ink);
}

.ta-rail-new-btn:active {
  transform: scale(0.992);
}

.ta-rail-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 7px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: background .14s, color .14s, border-color .14s;
}

.ta-rail-icon-btn:hover {
  background: var(--surface-2);
  border-color: var(--line);
  color: var(--ink);
}

.ta-rail-close-mobile {
  display: none;
}

.ta-rail-search {
  position: relative;
  display: flex;
  align-items: center;
  flex: none;
}

.ta-rail-search svg {
  position: absolute;
  left: 9px;
  color: var(--muted);
  pointer-events: none;
}

.ta-rail-search-inp {
  width: 100%;
  min-width: 0;
  height: 30px;
  padding: 0 26px 0 28px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--ink);
  font: inherit;
  font-size: 12.5px;
  box-sizing: border-box;
}

.ta-rail-search-inp:focus {
  outline: none;
  border-color: var(--accent);
}

.ta-rail-clear {
  position: absolute;
  right: 5px;
  width: 20px;
  height: 20px;
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 14px;
  cursor: pointer;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.ta-rail-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-right: 2px;
}

.ta-rail-section-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  padding: 2px 4px 0;
}

.ta-rail-list {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.ta-rail-row {
  position: relative;
  display: flex;
  align-items: center;
  gap: 3px;
  border-radius: 10px;
  border: 1px solid transparent;
  transition: background .12s, border-color .12s;
}

.ta-rail-row:hover {
  background: var(--surface-2);
}

.ta-rail-row.is-active {
  background: var(--accent-soft);
  border-color: rgba(45, 110, 240, 0.22);
}

.ta-rail-item {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 7px 8px;
  border: none;
  background: transparent;
  color: var(--ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.ta-rail-item-top {
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
}

.ta-rail-item-title {
  min-width: 0;
  flex: 1 1 auto;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12.5px;
  font-weight: 600;
}

.ta-rail-item-meta {
  font-size: 11px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ta-pin-dot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  flex: none;
}

.ta-pin-dot-btn {
  position: relative;
  z-index: 2;
  width: 20px;
  height: 20px;
  padding: 0;
  border: 0;
  border-radius: 5px;
  background: transparent;
  cursor: pointer;
  transition: background .12s, transform .12s;
}

.ta-pin-dot-btn:hover {
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  transform: scale(1.06);
}

.ta-pin-dot-btn.is-rail-pin {
  margin-left: 6px;
}

.ta-pin-dot-btn.is-work-pin {
  margin-left: 20px;
  margin-right: 0;
}

.ta-proj-chat-row.is-pinned .ta-proj-chat-btn {
  padding-left: 4px;
}

.ta-proj-chats.is-ungrouped .ta-pin-dot-btn.is-work-pin {
  margin-left: 6px;
  margin-right: 0;
}

.ta-proj-chats.is-ungrouped .ta-proj-chat-row.is-pinned .ta-proj-chat-btn {
  padding-left: 4px;
}

.ta-rail-act-btn.is-on {
  color: var(--accent);
}

.ta-rail-acts {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  gap: 1px;
  padding: 2px 3px 2px 18px;
  border-radius: 8px;
  background: linear-gradient(90deg, transparent 0%, var(--surface-2) 28%);
  flex: none;
  opacity: 0;
  pointer-events: none;
  transition: opacity .12s;
}

.ta-rail-row.is-active .ta-rail-acts {
  background: linear-gradient(90deg, transparent 0%, var(--accent-soft) 28%);
}

.ta-rail-row:hover .ta-rail-acts,
.ta-rail-row:focus-within .ta-rail-acts {
  opacity: 1;
  pointer-events: auto;
}

.ta-rail-act-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  cursor: pointer;
  padding: 0;
}

.ta-rail-act-btn:hover {
  background: var(--bg);
  color: var(--ink);
}

.ta-rail-act-btn.is-on {
  color: var(--accent);
}

.ta-rail-act-btn.is-del:hover {
  color: var(--danger, #e11d48);
}

.ta-rail-act-btn.is-save {
  color: var(--confirm);
  font-weight: 700;
}

.ta-rail-rename-form {
  display: flex;
  align-items: center;
  gap: 4px;
  width: 100%;
  padding: 4px;
  box-sizing: border-box;
}

.ta-rail-rename-inp {
  flex: 1 1 auto;
  min-width: 0;
  height: 28px;
  padding: 0 8px;
  border-radius: 8px;
  border: 1px solid var(--accent);
  background: var(--bg);
  color: var(--ink);
  font: inherit;
  font-size: 12.5px;
}

.ta-proj-dot {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  flex: none;
  background: var(--accent);
}

.ta-proj-dot.is-blue { background: #3b82f6; }
.ta-proj-dot.is-green { background: #10b981; }
.ta-proj-dot.is-amber { background: #f59e0b; }
.ta-proj-dot.is-purple { background: #8b5cf6; }
.ta-proj-dot.is-rose { background: #f43f5e; }
.ta-proj-dot.is-slate { background: #64748b; }

.ta-proj-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--bg);
  flex: none;
}

.ta-proj-field {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.ta-proj-lbl {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  padding-left: 2px;
}

.ta-proj-form-inp,
.ta-proj-sel-face {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: 12.5px;
  padding: 6px 10px;
}

.ta-proj-sel-wrap {
  position: relative;
  width: 100%;
  min-width: 0;
}

.ta-proj-sel-face {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 7px;
  line-height: 1.35;
  transition: border-color .15s, box-shadow .15s, background .15s;
}

.ta-proj-sel-btn {
  cursor: pointer;
  text-align: left;
  font-weight: 500;
}

.ta-proj-sel-btn.has-val {
  font-weight: 600;
}

.ta-proj-sel-ico {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  transition: color .15s;
}

.ta-proj-sel-btn.has-val .ta-proj-sel-ico,
.ta-proj-sel-wrap.is-open .ta-proj-sel-ico {
  color: var(--accent);
}

.ta-proj-sel-val {
  min-width: 0;
  flex: 1 1 auto;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ta-proj-sel-chev {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  transition: transform .16s cubic-bezier(.2, .8, .2, 1), color .15s;
}

.ta-proj-sel-wrap.is-open .ta-proj-sel-chev {
  transform: rotate(180deg);
  color: var(--accent);
}

.ta-proj-sel-wrap:hover .ta-proj-sel-face {
  border-color: var(--line-strong, var(--line));
}

.ta-proj-sel-wrap:hover .ta-proj-sel-chev,
.ta-proj-sel-wrap:focus-within .ta-proj-sel-chev {
  color: var(--ink);
}

.ta-proj-form-inp:focus,
.ta-proj-sel-btn:focus-visible,
.ta-proj-sel-btn.is-open {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 12%, transparent);
}

.ta-proj-sel-menu {
  position: absolute;
  top: calc(100% + 5px);
  left: 0;
  right: 0;
  z-index: 65;
  padding: 5px;
  border-radius: 12px;
  border: 1px solid var(--line-strong, var(--line));
  background: color-mix(in srgb, var(--surface) 98%, transparent);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 12px 32px rgba(15, 23, 42, .14);
  display: flex;
  flex-direction: column;
  gap: 4px;
  box-sizing: border-box;
}

.ta-proj-sel-search-wrap {
  padding: 1px 1px 2px;
}

.ta-proj-sel-search {
  width: 100%;
  box-sizing: border-box;
  height: 28px;
  padding: 0 9px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--ink);
  font: inherit;
  font-size: 12px;
}

.ta-proj-sel-search:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--surface);
}

.ta-proj-sel-list {
  max-height: 216px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.ta-proj-sel-sep {
  height: 1px;
  background: var(--line);
  margin: 3px 4px;
}

.ta-proj-sel-opt {
  width: 100%;
  box-sizing: border-box;
  display: flex;
  align-items: flex-start;
  gap: 7px;
  padding: 6px 8px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 12px;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  transition: background .12s, color .12s;
}

.ta-proj-sel-opt:hover {
  background: var(--surface-2);
}

.ta-proj-sel-opt.is-selected {
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  color: var(--accent);
  font-weight: 600;
}

.ta-proj-sel-opt-ico {
  flex: none;
  margin-top: 2px;
  color: var(--muted);
}

.ta-proj-sel-opt.is-selected .ta-proj-sel-opt-ico {
  color: var(--accent);
}

.ta-proj-sel-opt-body {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.ta-proj-sel-opt-title {
  line-height: 1.3;
  word-break: break-word;
}

.ta-proj-sel-opt-meta {
  font-size: 10.5px;
  font-weight: 500;
  color: var(--muted);
}

.ta-proj-sel-check {
  flex: none;
  margin-top: 2px;
  color: var(--accent);
}

.ta-proj-sel-empty {
  padding: 10px 8px;
  font-size: 11.5px;
  color: var(--muted);
  text-align: center;
}

.ta-proj-colors {
  display: flex;
  align-items: center;
  gap: 6px;
}

.ta-proj-swatch {
  width: 20px;
  height: 20px;
  border-radius: 999px;
  border: 2px solid transparent;
  padding: 0;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-2);
}

.ta-proj-swatch.is-active {
  border-color: var(--ink);
  transform: scale(1.08);
}

.ta-proj-form-btns {
  display: flex;
  align-items: center;
  gap: 6px;
}

.ta-proj-form-btns .btn {
  flex: 1 1 auto;
  justify-content: center;
}

.ta-proj-src-seg {
  display: flex;
  align-items: stretch;
  gap: 3px;
  padding: 3px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  min-width: 0;
}

.ta-proj-src-tab {
  flex: 1 1 auto;
  min-width: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 5px 5px;
  border-radius: 7px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--ink-2);
  font: inherit;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: background .15s, border-color .15s, color .15s;
}

.ta-proj-src-tab:hover {
  color: var(--ink);
}

.ta-proj-src-tab.is-active {
  background: var(--surface);
  border-color: var(--accent);
  color: var(--accent);
  box-shadow: 0 1px 3px rgba(0, 0, 0, .06);
}

.ta-proj-src-tab svg {
  flex: none;
}

.ta-proj-src-box {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 6px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--surface);
}

.ta-proj-remote-btn {
  width: 100%;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 7px 9px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--ink);
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
  transition: background .15s, border-color .15s;
}

.ta-proj-remote-btn:hover {
  background: var(--surface-2);
  border-color: var(--line-strong, var(--line));
}

.ta-proj-remote-left {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.ta-proj-remote-left svg {
  flex: none;
  color: var(--muted);
}

.ta-proj-remote-status {
  font-size: 11px;
  font-weight: 500;
  color: var(--muted);
  white-space: nowrap;
  max-width: 130px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ta-proj-remote-status.is-connected {
  color: var(--good, #16a34a);
  font-weight: 600;
}

.ta-proj-remote-btn.is-open {
  border-color: var(--accent, #2563eb);
  background: var(--surface-2);
}

.ta-proj-remote-panel {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--bg);
}

.ta-remote-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  flex-wrap: wrap;
  font-size: 11px;
  color: var(--muted);
}

.ta-remote-oauth-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  width: 100%;
  box-sizing: border-box;
  padding: 6px 8px;
  border-radius: 7px;
  border: 1px solid color-mix(in srgb, var(--accent, #2563eb) 35%, var(--line));
  background: color-mix(in srgb, var(--accent, #2563eb) 10%, var(--surface));
  color: var(--ink);
  font-size: 11.5px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}

.ta-remote-oauth-btn:hover {
  background: color-mix(in srgb, var(--accent, #2563eb) 16%, var(--surface));
}

.ta-remote-inp-row,
.ta-remote-split-row {
  display: flex;
  gap: 5px;
  align-items: center;
}

.ta-remote-inp-row .ta-proj-form-inp,
.ta-remote-split-row .ta-proj-form-inp {
  min-width: 0;
  flex: 1 1 auto;
  font-size: 11.5px;
  padding: 5px 8px;
}

.ta-remote-go-btn,
.ta-remote-full-btn {
  flex: none;
  font-size: 11.5px;
  padding: 5px 9px;
}

.ta-remote-full-btn {
  width: 100%;
}

.ta-remote-picker-list {
  display: flex;
  flex-direction: column;
  gap: 3px;
  max-height: 120px;
  overflow-y: auto;
  padding-top: 2px;
}

.ta-remote-pick-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  width: 100%;
  box-sizing: border-box;
  padding: 4px 6px;
  border-radius: 6px;
  border: 1px solid transparent;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: 11px;
  text-align: left;
  cursor: pointer;
}

.ta-remote-pick-row:hover {
  border-color: var(--line-strong, var(--line));
  background: var(--surface-2);
}

.ta-remote-pick-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ta-remote-pick-tag {
  flex: none;
  font-size: 10px;
  color: var(--muted);
}

.ta-remote-synced {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  font-size: 11px;
  color: var(--good, #16a34a);
}

.ta-remote-err {
  font-size: 11px;
  color: var(--bad, #dc2626);
  line-height: 1.3;
}

.ta-remote-link-btn {
  border: 0;
  background: transparent;
  padding: 0;
  font: inherit;
  font-size: 11px;
  font-weight: 600;
  color: var(--accent, #2563eb);
  cursor: pointer;
}

.ta-remote-link-btn.is-danger {
  color: var(--bad, #dc2626);
}

.ta-proj-pc-note {
  font-size: 11.5px;
  line-height: 1.35;
  color: var(--muted);
  padding: 2px 2px 3px;
}

.ta-proj-dl-btns {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ta-proj-dl-btn {
  width: 100%;
  min-width: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 34px;
  padding: 0 10px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--ink);
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: background .15s, border-color .15s, color .15s;
}

.ta-proj-dl-btn svg {
  flex: none;
  width: 14px;
  height: 14px;
}

.ta-proj-dl-btn:hover {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
}

.ta-rail-backdrop {
  display: none;
}

/* ---------- Projects tree & nested chats + composer context bar ---------- */

.ta-rail-icon-btn.is-open {
  background: var(--accent-soft);
  border-color: color-mix(in srgb, var(--accent) 32%, var(--line));
  color: var(--accent);
}

.ta-proj-rail-head {
  padding-top: 2px;
}

.ta-proj-tree-scroll {
  padding-bottom: 68px;
}

.ta-proj-group {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.ta-proj-folder-row {
  position: relative;
  display: flex;
  align-items: center;
  border-radius: 9px;
  transition: background .12s;
}

.ta-proj-folder-row:hover {
  background: var(--surface-2);
}

.ta-proj-folder-row.is-active {
  background: color-mix(in srgb, var(--surface-2) 75%, transparent);
}

.ta-proj-folder-ico-btn {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 2px 6px 8px;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.ta-proj-folder-btn {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 6px 8px 6px 5px;
  border: 0;
  background: transparent;
  color: var(--ink-2);
  font: inherit;
  font-size: 12.5px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
}

.ta-proj-folder-row.is-active .ta-proj-folder-btn,
.ta-proj-folder-btn:hover {
  color: var(--ink);
}

.ta-proj-folder-ico {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  color: var(--muted);
}

.ta-proj-folder-ico.is-blue { color: #3b82f6; }
.ta-proj-folder-ico.is-green { color: #10b981; }
.ta-proj-folder-ico.is-amber { color: #f59e0b; }
.ta-proj-folder-ico.is-purple { color: #8b5cf6; }
.ta-proj-folder-ico.is-rose { color: #f43f5e; }
.ta-proj-folder-ico.is-slate { color: #64748b; }

.ta-proj-folder-title {
  min-width: 0;
  flex: 1 1 auto;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ta-proj-folder-acts {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  gap: 1px;
  padding: 2px 2px 2px 14px;
  border-radius: 7px;
  background: linear-gradient(90deg, transparent 0%, var(--surface-2) 30%);
  opacity: 0;
  pointer-events: none;
  transition: opacity .12s;
}

.ta-proj-folder-row:hover .ta-proj-folder-acts,
.ta-proj-folder-row:focus-within .ta-proj-folder-acts,
.ta-proj-folder-row.is-menu-open .ta-proj-folder-acts {
  opacity: 1;
  pointer-events: auto;
}

.ta-proj-chats {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.ta-proj-chat-row {
  position: relative;
  display: flex;
  align-items: center;
  border-radius: 10px;
  border: 1px solid transparent;
  transition: background .12s, border-color .12s;
}

.ta-proj-chat-row:hover {
  background: var(--surface-2);
}

.ta-proj-chat-row.is-active {
  background: var(--surface);
  border-color: var(--line-strong, var(--line));
  box-shadow: 0 1px 3px rgba(15, 23, 42, .05);
}

.ta-proj-chat-btn {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 8px 6px 26px;
  border: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 12.5px;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
}

.ta-proj-chats.is-ungrouped .ta-proj-chat-btn {
  padding-left: 10px;
}

.ta-proj-chat-row.is-active .ta-proj-chat-btn {
  font-weight: 600;
}

.ta-proj-chat-title {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ta-proj-chat-age {
  flex: none;
  font-size: 11px;
  color: var(--muted);
  margin-left: 4px;
}

.ta-proj-chat-acts {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  gap: 1px;
  padding: 2px 3px 2px 18px;
  border-radius: 8px;
  background: linear-gradient(90deg, transparent 0%, var(--surface-2) 30%);
  opacity: 0;
  pointer-events: none;
  transition: opacity .12s;
}

.ta-proj-chat-row.is-active .ta-proj-chat-acts {
  background: linear-gradient(90deg, transparent 0%, var(--surface) 30%);
}

.ta-proj-chat-row:hover .ta-proj-chat-acts,
.ta-proj-chat-row:focus-within .ta-proj-chat-acts,
.ta-proj-chat-row.is-menu-open .ta-proj-chat-acts {
  opacity: 1;
  pointer-events: auto;
}

.ta-proj-empty-add {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 8px 5px 26px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 12px;
  cursor: pointer;
  text-align: left;
  transition: background .12s, color .12s;
}

.ta-proj-empty-add:hover {
  background: var(--surface-2);
  color: var(--ink);
}

.ta-proj-ungrouped {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px solid var(--line);
}

.ta-proj-ungrouped-head {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  padding: 0 8px;
}

.ta-rail-row-menu {
  position: absolute;
  right: 4px;
  top: calc(100% + 2px);
  min-width: 172px;
  padding: 4px;
  border-radius: 11px;
  border: 1px solid var(--line-strong, var(--line));
  background: color-mix(in srgb, var(--surface) 97%, transparent);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 10px 28px rgba(15, 23, 42, .16);
  display: flex;
  flex-direction: column;
  gap: 2px;
  z-index: 45;
}

.ta-rail-row-menu-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 9px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 12px;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
}

.ta-rail-row-menu-item:hover {
  background: var(--surface-2);
}

.ta-rail-row-menu-item.is-danger {
  color: var(--danger, #e11d48);
}

.ta-proj-files-list {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 2px 0;
}

.ta-proj-file-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  max-width: 100%;
  padding: 3px 6px;
  border-radius: 7px;
  border: 1px solid var(--line);
  background: var(--bg);
  font-size: 11px;
  color: var(--ink-2);
}

.ta-proj-file-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 140px;
}

.ta-proj-file-x {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  line-height: 1;
  padding: 0 2px;
  cursor: pointer;
}

.ta-proj-file-x:hover {
  color: var(--danger, #e11d48);
}

.ta-ag-composer-shell {
  display: flex;
  flex-direction: column;
  border-radius: 18px;
  border: 1px solid var(--line-strong, var(--line));
  background: color-mix(in srgb, var(--surface-2) 65%, var(--bg));
}

.ta-ag-composer-shell .ta-ag-composer {
  border-radius: 16px;
  margin: -1px;
  width: calc(100% + 2px);
}

.ta-ctx-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 8px;
  padding: 6px 12px;
  min-height: 32px;
  box-sizing: border-box;
}

.ta-ctx-anchor {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.ta-ctx-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 26px;
  padding: 0 8px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--ink-2);
  font: inherit;
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  transition: background .14s, color .14s;
}

.ta-ctx-pill:hover,
.ta-ctx-pill.is-open {
  background: color-mix(in srgb, var(--surface) 85%, var(--surface-2));
  color: var(--ink);
}

.ta-ctx-pill svg {
  flex: none;
}

.ta-ctx-meta-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 24px;
  padding: 0 8px;
  border-radius: 7px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  font: inherit;
  font-size: 11.5px;
  font-weight: 500;
  max-width: 190px;
}

.ta-ctx-meta-chip span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ta-ctx-meta-chip.is-btn {
  cursor: pointer;
  color: var(--ink-2);
  transition: border-color .14s, color .14s, background .14s;
}

.ta-ctx-meta-chip.is-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.ta-ctx-files-anchor {
  margin-left: auto;
}

.ta-ctx-popover {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 0;
  width: 272px;
  padding: 6px;
  border-radius: 14px;
  border: 1px solid var(--line-strong, var(--line));
  background: color-mix(in srgb, var(--surface) 97%, transparent);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow: 0 14px 36px rgba(15, 23, 42, .18);
  z-index: 60;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.ta-ctx-popover.is-files {
  left: auto;
  right: 0;
  width: 240px;
  padding: 8px;
}

.ta-ctx-env-opt {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 9px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: background .12s;
}

.ta-ctx-env-opt:hover,
.ta-ctx-env-opt.is-active {
  background: var(--surface-2);
}

.ta-ctx-env-ico {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-2);
  flex: none;
}

.ta-ctx-env-copy {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.ta-ctx-env-copy b {
  font-size: 12.5px;
  font-weight: 600;
}

.ta-ctx-env-copy span {
  font-size: 11px;
  color: var(--muted);
}

.ta-ctx-env-right {
  flex: none;
  color: var(--accent);
  display: inline-flex;
  align-items: center;
}

.ta-ctx-env-dl {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 6px 4px 2px;
}

.ta-ctx-divider {
  height: 1px;
  background: var(--line);
  margin: 3px 2px;
}

.ta-ctx-proj-search-wrap {
  position: relative;
  display: flex;
  align-items: center;
  padding: 2px 2px 4px;
}

.ta-ctx-proj-search-wrap svg {
  position: absolute;
  left: 11px;
  color: var(--muted);
  pointer-events: none;
}

.ta-ctx-proj-search-inp {
  width: 100%;
  height: 30px;
  padding: 0 10px 0 28px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--ink);
  font: inherit;
  font-size: 12.5px;
  box-sizing: border-box;
}

.ta-ctx-proj-search-inp:focus {
  outline: none;
  border-color: var(--accent);
}

.ta-ctx-proj-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-height: 220px;
  overflow-y: auto;
}

.ta-ctx-proj-row {
  position: relative;
  display: flex;
  align-items: center;
  border-radius: 8px;
}

.ta-ctx-proj-row:hover,
.ta-ctx-proj-row.is-active {
  background: var(--surface-2);
}

.ta-ctx-proj-pick {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 6px 8px;
  border: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 12.5px;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
}

.ta-ctx-proj-row.is-active .ta-ctx-proj-pick {
  font-weight: 600;
}

.ta-ctx-proj-left {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  flex: 1 1 auto;
}

.ta-ctx-proj-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ta-ctx-proj-check {
  flex: none;
  color: var(--accent);
  display: inline-flex;
}

.ta-ctx-proj-gear {
  flex: none;
  width: 24px;
  height: 24px;
  margin-right: 4px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  transition: opacity .12s, background .12s, color .12s;
}

.ta-ctx-proj-row:hover .ta-ctx-proj-gear,
.ta-ctx-proj-gear:focus-visible {
  opacity: 1;
}

.ta-ctx-proj-gear:hover {
  background: var(--bg);
  color: var(--ink);
}

.ta-ctx-footer-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 9px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 12.5px;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  transition: background .12s;
}

.ta-ctx-footer-btn:hover,
.ta-ctx-footer-btn.is-active {
  background: var(--surface-2);
}

.ta-ctx-files-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  padding: 2px 4px 4px;
}

.ta-ctx-files-list {
  display: flex;
  flex-direction: column;
  gap: 3px;
  max-height: 180px;
  overflow-y: auto;
}

.ta-ctx-file-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 6px;
  border-radius: 7px;
  background: var(--bg);
  font-size: 12px;
  color: var(--ink-2);
}

.ta-ctx-file-row span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (hover: none), (max-width: 959px) {
  .ta-rail-acts,
  .ta-proj-folder-acts,
  .ta-proj-chat-acts,
  .ta-ctx-proj-gear {
    opacity: 1;
    pointer-events: auto;
    background: transparent;
    padding-left: 4px;
  }
  .ta-rail-row.is-active .ta-rail-acts,
  .ta-proj-chat-row.is-active .ta-proj-chat-acts {
    background: transparent;
  }
  .ta-rail-item {
    padding-right: 74px;
  }
  .ta-proj-folder-btn {
    padding-right: 54px;
  }
  .ta-proj-chat-btn {
    padding-right: 54px;
  }
}

@media (max-width: 959px) {
  #ta-workspace.ta-shell {
    padding: 10px 14px 14px;
    gap: 10px;
  }
  .ta-rail-mode-head {
    display: none;
  }
  .ta-mode-seg-inline {
    display: none !important;
  }
  .ta-workspace-body {
    grid-template-columns: minmax(0, 1fr);
    border: 1px solid var(--line);
    border-radius: 16px;
  }
  .ta-workspace-body .ta-open-chat {
    border-radius: 16px;
  }
  .ta-workspace-body .ta-entity-rail {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    width: min(300px, 86vw);
    max-width: 100%;
    z-index: 95;
    border-right: 1px solid var(--line);
    border-radius: 0 16px 16px 0;
    background: var(--surface);
    box-shadow: 0 16px 42px rgba(15, 23, 42, 0.24);
    transform: translateX(-105%);
    transition: transform .2s ease;
    display: flex !important;
  }
  .ta-workspace-body .ta-entity-rail.is-open {
    transform: translateX(0);
  }
  .ta-rail-resizer {
    display: none !important;
  }
  .ta-rail-backdrop.is-open {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 90;
    background: rgba(15, 23, 42, 0.42);
  }
  .ta-rail-close-mobile {
    display: inline-flex;
  }
}

@media (max-width: 899px) {
  #ta-workspace.ta-shell {
    padding: 8px 12px 10px;
    gap: 8px;
  }
  .ta-workspace-body {
    border: 0;
    border-radius: 0;
    background: transparent;
  }
  .ta-workspace-body .ta-open-chat {
    border-radius: 0;
    background: transparent;
  }
  .ta-open-chat > .ta-session-bar {
    height: auto;
    min-height: 34px;
    padding: 0 0 6px;
    border-bottom: 0;
  }
  .ta-rail-toggle-btn {
    border-color: var(--line);
    background: var(--surface);
  }
  .ta-open-chat > .ta-session-bar .ta-session-trigger {
    border-color: var(--line);
    background: var(--surface);
    padding: 0 10px;
  }
  #ta-workspace .ta-workspace-body .ta-chat-log {
    padding: 8px 2px;
  }
  .ta-chat-inner {
    max-width: none;
  }
  #ta-workspace .ta-workspace-body .ta-ag-composer-wrap {
    max-width: none;
    padding: 4px 0 0;
  }
  .ta-course-pill-row {
    max-width: none;
    padding: 2px 0 6px;
  }
}

:root[data-theme="dark"] .ta-workspace-body,
:root[data-theme="dark"] .ta-workspace-body .ta-open-chat {
  background: var(--surface);
  border-color: var(--line);
}

:root[data-theme="dark"] .ta-entity-rail {
  background: var(--bg);
  border-color: var(--line);
}

:root[data-theme="dark"] .ta-rail-toggle-btn:hover {
  background: var(--surface-2);
  border-color: var(--line);
}

:root[data-theme="dark"] .ta-proj-form,
:root[data-theme="dark"] .ta-proj-src-box,
:root[data-theme="dark"] .ta-proj-sel-face,
:root[data-theme="dark"] .ta-proj-sel-search,
:root[data-theme="dark"] .ta-rail-search-inp,
:root[data-theme="dark"] .ta-rail-rename-inp {
  background: var(--bg);
  border-color: var(--line);
}

:root[data-theme="dark"] .ta-proj-src-tab.is-active {
  background: var(--surface-2);
}

:root[data-theme="dark"] .ta-proj-remote-btn,
:root[data-theme="dark"] .ta-proj-remote-panel,
:root[data-theme="dark"] .ta-remote-pick-row,
:root[data-theme="dark"] .ta-proj-dl-btn,
:root[data-theme="dark"] .ta-proj-file-chip,
:root[data-theme="dark"] .ta-ctx-meta-chip,
:root[data-theme="dark"] .ta-ctx-file-row,
:root[data-theme="dark"] .ta-ctx-proj-search-inp {
  background: var(--surface);
  border-color: var(--line);
}

:root[data-theme="dark"] .ta-ag-composer-shell {
  background: color-mix(in srgb, var(--surface-2) 60%, var(--bg));
  border-color: var(--line-strong, var(--line));
}

:root[data-theme="dark"] .ta-ctx-popover,
:root[data-theme="dark"] .ta-proj-sel-menu,
:root[data-theme="dark"] .ta-rail-row-menu {
  background: color-mix(in srgb, var(--surface) 96%, transparent);
  border-color: var(--line-strong, var(--line));
}

:root[data-theme="dark"] .ta-proj-chat-row.is-active {
  background: var(--surface-2);
  border-color: var(--line-strong, var(--line));
}

:root[data-theme="dark"] .ta-proj-chat-row.is-active .ta-proj-chat-acts {
  background: linear-gradient(90deg, transparent 0%, var(--surface-2) 30%);
}

:root[data-theme="dark"] .ta-rail-new-btn {
  background: color-mix(in srgb, var(--surface-2) 72%, var(--surface));
  border-color: var(--line-strong);
  color: var(--ink);
}

:root[data-theme="dark"] .ta-rail-new-btn:hover {
  background: var(--surface-2);
  border-color: color-mix(in srgb, var(--ink) 22%, var(--line-strong));
}

/* ---------- Auto @-trigger preview, requirements block & smart course proposal ---------- */

.ta-auto-cmd-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 10px;
  margin-bottom: 6px;
  border-radius: 10px;
  background: color-mix(in srgb, var(--accent-soft) 70%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--accent) 22%, var(--line));
  font-size: 12px;
  line-height: 1.3;
  color: var(--ink-2);
}

.ta-auto-cmd-text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ta-cmd-pill {
  display: inline-flex;
  align-items: center;
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 700;
  background: var(--accent-soft);
  color: var(--accent);
}

.ta-cmd-pill.is-auto {
  background: color-mix(in srgb, var(--confirm) 14%, transparent);
  color: var(--confirm);
}

.ta-scope-pill {
  display: inline-flex;
  align-items: center;
  flex: none;
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 600;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--muted);
  white-space: nowrap;
}

.ta-scope-pill.is-own {
  background: color-mix(in srgb, var(--confirm) 12%, transparent);
  border-color: color-mix(in srgb, var(--confirm) 28%, transparent);
  color: var(--confirm);
}

.ta-scope-pill.is-dept {
  background: var(--accent-soft);
  border-color: color-mix(in srgb, var(--accent) 25%, transparent);
  color: var(--accent);
}

.ta-req-box {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
  gap: 8px;
  padding: 9px 11px;
  border-radius: 10px;
  background: color-mix(in srgb, var(--accent-soft) 45%, var(--surface-2));
  border: 1px solid color-mix(in srgb, var(--accent) 22%, var(--line));
}

.ta-req-box.is-compact {
  padding: 0;
  border: 0;
  background: transparent;
}

.ta-req-item.is-compact {
  padding: 7px 10px;
  gap: 4px;
}

.ta-req-item.is-compact .ta-req-cite .ta-rag-go {
  margin-left: auto;
}

.ta-req-box-title {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: .03em;
}

.ta-req-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
  gap: 5px;
  padding: 8px 10px;
  border-radius: 8px;
  background: var(--surface);
  border: 1px solid var(--line);
}

.ta-req-cite {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 6px;
  font-size: 12.5px;
  color: var(--ink);
}

.ta-req-list {
  margin: 2px 0 0 16px;
  padding: 0;
  display: grid;
  gap: 3px;
  font-size: 12px;
  line-height: 1.4;
  color: var(--ink-2);
}

.ta-req-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  font-size: 11.5px;
  color: var(--muted);
}

.ta-proposal-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
  gap: 10px;
  padding: 12px;
  border-radius: 12px;
  background: var(--surface);
  border: 1px solid color-mix(in srgb, var(--accent) 28%, var(--line));
  box-shadow: 0 2px 10px rgba(15, 23, 42, .04);
}

.ta-proposal-card .chip-btn {
  max-width: 100%;
  white-space: normal;
  text-align: left;
  height: auto;
  min-height: 32px;
  line-height: 1.3;
  padding: 6px 11px;
  overflow-wrap: anywhere;
}

.ta-proposal-card .ta-input,
.ta-proposal-card .stu-notch-field {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}

.ta-proposal-card.is-enrichment.is-collapsed {
  padding: 8px 11px;
  gap: 0;
  box-shadow: none;
}

.ta-proposal-card.is-collapsed .ta-prop-collapsible,
.ta-proposal-card.is-collapsed .ta-prop-sub {
  display: none;
}

.ta-prop-collapsible {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
  gap: 10px;
}

.ta-prop-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}

.ta-prop-head-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.ta-prop-sum-course {
  font-weight: 500;
  font-size: 12px;
  color: var(--muted);
}

.ta-prop-title-wrap {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 2px;
  min-width: 0;
}

.ta-prop-title-wrap b {
  font-size: 13.5px;
  color: var(--ink);
  overflow-wrap: anywhere;
}

.ta-prop-sub {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.35;
  min-width: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
}

.ta-prop-why {
  padding: 7px 10px;
  border-radius: 8px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  font-size: 12px;
  line-height: 1.35;
  color: var(--ink-2);
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
  overflow-wrap: anywhere;
}

.ta-prop-seg {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
}

.ta-prop-block {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
  gap: 6px;
}

.ta-prop-row-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  min-width: 0;
  gap: 8px;
}

.ta-prop-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-2);
}

.ta-prop-search {
  min-height: 32px;
  height: 32px;
  font-size: 12.5px;
}

.ta-prop-courses {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
  gap: 6px;
  max-height: 190px;
  overflow-y: auto;
}

.ta-prop-course-opt {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
  gap: 2px;
  width: 100%;
  text-align: left;
  padding: 8px 10px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--ink);
  font: inherit;
  cursor: pointer;
  transition: border-color .14s, background .14s;
}

.ta-prop-course-opt:hover {
  border-color: color-mix(in srgb, var(--accent) 45%, var(--line));
}

.ta-prop-course-opt.is-active {
  background: color-mix(in srgb, var(--accent-soft) 72%, var(--surface));
  border-color: var(--accent);
}

.ta-prop-course-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 6px;
  min-width: 0;
  font-size: 12.5px;
}

.ta-prop-course-top b {
  flex: 1 1 auto;
  min-width: 0;
  overflow-wrap: anywhere;
  line-height: 1.3;
}

.ta-prop-course-badges {
  flex: none;
}

.ta-prop-course-meta {
  font-size: 11.5px;
  line-height: 1.35;
  color: var(--muted);
  min-width: 0;
  overflow-wrap: anywhere;
}

.ta-prop-chips {
  display: flex;
  flex-wrap: wrap;
  min-width: 0;
  gap: 6px;
}

.ta-prop-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
  gap: 8px;
}

.ta-prop-fld {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
  gap: 4px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--muted);
}

.ta-prop-fld .ta-input {
  font-weight: 400;
  color: var(--ink);
}

.ta-prop-mat-note {
  padding: 8px 10px;
  border-radius: 8px;
  background: var(--surface-2);
  border: 1px dashed var(--line-strong, var(--line));
  font-size: 12px;
  line-height: 1.4;
  color: var(--ink-2);
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
  overflow-wrap: anywhere;
}

.ta-prop-err {
  padding: 6px 9px;
  border-radius: 8px;
  background: color-mix(in srgb, #ef4444 12%, transparent);
  color: #dc2626;
  font-size: 12px;
}

.ta-prop-plan-preview {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
  gap: 8px;
  padding: 10px 11px;
  border-radius: 10px;
  background: var(--bg);
  border: 1px solid var(--line);
}

.ta-prop-plan-head {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.ta-prop-plan-list {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  min-width: 0;
  gap: 5px;
}

.ta-prop-plan-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
  gap: 3px;
  padding: 6px 9px;
  border-radius: 8px;
  background: var(--surface);
  border: 1px solid var(--line);
}

.ta-prop-plan-row.is-hw {
  border-color: color-mix(in srgb, var(--accent) 42%, var(--line));
  background: color-mix(in srgb, var(--accent) 6%, var(--surface));
}

.ta-prop-plan-row-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 4px 8px;
}

.ta-prop-plan-title {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink);
  min-width: 0;
  overflow-wrap: anywhere;
}

.ta-prop-plan-min {
  flex: none;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--surface-2, rgba(15, 23, 42, .06));
  color: var(--muted);
}

.ta-prop-plan-row.is-hw .ta-prop-plan-min {
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  color: var(--accent);
}

.ta-prop-plan-rubric {
  font-size: 11.5px;
  color: var(--ink-2, var(--muted));
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.ta-prop-foot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.ta-prop-done {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 10px;
  background: color-mix(in srgb, var(--confirm) 10%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--confirm) 30%, var(--line));
}

.ta-prop-done-text {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--confirm);
}

.ta-prop-dismissed {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 9px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  font-size: 12px;
  color: var(--muted);
}

@media (max-width: 720px) {
  .ta-prop-head {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 640px) {
  .ta-msg.is-assistant {
    padding: 10px 10px;
    border-radius: 14px;
  }
  .ta-proposal-card {
    padding: 10px;
    gap: 9px;
  }
  .ta-prop-seg {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
  }
  .ta-prop-seg .chip-btn {
    width: 100%;
    justify-content: center;
    text-align: center;
    font-size: 12px;
    padding: 7px 8px;
  }
  .ta-prop-courses {
    max-height: 260px;
    padding-right: 2px;
  }
  .ta-prop-foot .btn {
    width: 100%;
    justify-content: center;
  }
  .ta-ctx-bar {
    position: relative;
    padding: 5px 8px;
    gap: 4px 6px;
  }
  .ta-ctx-anchor {
    position: static;
  }
  .ta-ctx-popover,
  .ta-ctx-popover.is-files {
    left: 0;
    right: 0;
    width: auto;
    max-width: 100%;
  }
  .ta-ctx-pill {
    padding: 0 6px;
    font-size: 12px;
    max-width: 100%;
  }
  .ta-ctx-pill span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 145px;
  }
  .ta-ctx-files-anchor {
    margin-left: 0;
  }
}

.ta-pub-mem-box,
.ta-pub-empty-box {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
  gap: 6px;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--surface);
  border: 1px solid var(--line);
}

.ta-pub-empty-box {
  border-style: dashed;
  border-color: color-mix(in srgb, var(--warn, #d97706) 36%, var(--line));
  background: color-mix(in srgb, var(--surface-2) 65%, var(--surface));
}

.ta-pub-mem-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.ta-pub-hidden-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.2;
  background: color-mix(in srgb, var(--warn, #d97706) 13%, var(--surface));
  color: var(--warn, #b45309);
  border: 1px solid color-mix(in srgb, var(--warn, #d97706) 30%, transparent);
  white-space: nowrap;
}

.ta-pub-hidden-pill svg {
  width: 12px;
  height: 12px;
  flex: none;
}

.ta-pub-alt-mods {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
  gap: 5px;
  margin-top: 2px;
}

.ta-pub-empty-acts {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
}

.ta-pub-foot-split {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.ta-ann-card {
  gap: 10px;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}

.ta-ann-card .ta-prop-block {
  min-width: 0;
}

.ta-ann-card .chip-btn {
  max-width: 100%;
  white-space: normal;
  text-align: left;
  height: auto;
  line-height: 1.3;
}

.ta-ann-card .ta-input {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.ta-ann-warn {
  padding: 9px 12px;
  border-radius: 9px;
  background: color-mix(in srgb, var(--warn, #d97706) 11%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--warn, #d97706) 36%, var(--line));
  color: var(--ink);
  font-size: 12.5px;
  line-height: 1.4;
}

.ta-ann-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.ta-ann-field {
  display: grid;
  gap: 4px;
  min-width: 0;
  align-content: start;
}

.ta-ann-field-wide,
.stu-notch-field.ta-ann-field-wide {
  grid-column: 1 / -1;
}

.ta-ann-field-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  flex-wrap: wrap;
}

.ta-ann-field-lbl {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--muted);
}

.ta-ann-suggest-chip {
  justify-self: start;
  font-size: 11.5px;
  padding: 4px 8px;
}

.ta-ann-body {
  width: 100%;
  box-sizing: border-box;
  min-height: 84px;
  resize: vertical;
  line-height: 1.45;
  font-size: 13.5px;
}

.ta-ann-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.btn.ta-ann-wa-btn {
  background: #16a34a;
  border-color: #15803d;
  color: #ffffff;
}

.btn.ta-ann-wa-btn:hover:not(:disabled) {
  background: #15803d;
  border-color: #166534;
  color: #ffffff;
}

.btn.ta-ann-tg-btn {
  background: #0284c7;
  border-color: #0369a1;
  color: #ffffff;
}

.btn.ta-ann-tg-btn:hover:not(:disabled) {
  background: #0369a1;
  border-color: #075985;
  color: #ffffff;
}

.btn.ta-ann-wa-btn:disabled,
.btn.ta-ann-tg-btn:disabled {
  opacity: 0.48;
  cursor: not-allowed;
}

.ta-ann-ext-note {
  font-size: 12px;
  color: var(--muted);
}

@media (max-width: 640px) {
  .ta-ann-fields {
    grid-template-columns: 1fr;
  }
}

/* ---------- Подписка (490 / 1 990 / 9 900 ₽), закрываемое уведомление и кнопка «Купить подписку» ---------- */

.ta-limits-notice {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin: 4px 4px 6px;
  padding: 8px 10px;
  border-radius: 10px;
  background: color-mix(in srgb, var(--accent) 8%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--accent) 22%, var(--line));
  font-size: 12px;
  line-height: 1.35;
  color: var(--ink);
  box-sizing: border-box;
}

.ta-limits-notice-ico {
  color: var(--accent);
  flex: 0 0 auto;
  margin-top: 1px;
  display: inline-grid;
  place-items: center;
}

.ta-limits-notice-copy {
  flex: 1 1 auto;
  min-width: 0;
  display: grid;
  gap: 2px;
}

.ta-limits-notice-copy b {
  font-weight: 600;
  color: var(--ink);
}

.ta-limits-notice-copy span {
  font-size: 11.5px;
  color: var(--muted);
}

.ta-limits-close {
  flex: 0 0 auto;
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  padding: 0;
  border-radius: 6px;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: background .14s, color .14s;
}

.ta-limits-close:hover {
  background: color-mix(in srgb, var(--ink) 8%, transparent);
  color: var(--ink);
}

.ta-limits-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
  padding: 8px 10px 8px 12px;
  border-radius: 12px;
  background: color-mix(in srgb, var(--accent) 7%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--accent) 22%, var(--line));
  font-size: 12.5px;
  line-height: 1.35;
  color: var(--ink);
  box-sizing: border-box;
}

.ta-limits-bar-main {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1 1 auto;
  min-width: 0;
}

.ta-limits-bar-text {
  flex: 1 1 auto;
  min-width: 0;
  color: var(--ink-2);
}

.ta-limits-bar-text b {
  color: var(--ink);
  font-weight: 600;
}

.ta-limits-bar-acts {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex: 0 0 auto;
}

.ta-limits-cta-btn {
  display: inline-flex;
  align-items: center;
  height: 28px;
  padding: 0 11px;
  border-radius: 999px;
  border: 0;
  background: var(--accent);
  color: var(--accent-ink);
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: opacity .15s, transform .12s;
}

.ta-limits-cta-btn:hover {
  opacity: .92;
}

.ta-model-footer {
  display: grid;
  gap: 4px;
  padding-top: 2px;
}

.ta-model-buy-btn {
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  min-height: 36px;
  padding: 7px 10px;
  border-radius: 9px;
  border: 1px solid color-mix(in srgb, var(--accent) 28%, var(--line));
  background: var(--accent);
  color: var(--accent-ink);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  transition: opacity .14s, transform .12s;
}

.ta-model-buy-btn:hover {
  opacity: .94;
}

.ta-model-buy-btn.is-manage {
  background: color-mix(in srgb, var(--accent) 12%, var(--surface));
  color: var(--accent);
}

.ta-model-buy-price {
  font-size: 11.5px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .18);
  white-space: nowrap;
}

.ta-model-buy-btn.is-manage .ta-model-buy-price {
  background: color-mix(in srgb, var(--accent) 16%, transparent);
}

.ta-sub-backdrop {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(15, 23, 42, .56);
  backdrop-filter: blur(4px);
  box-sizing: border-box;
}

.ta-sub-modal {
  position: relative;
  width: min(920px, 100%);
  max-height: min(90dvh, 760px);
  overflow-y: auto;
  border-radius: 20px;
  background: var(--surface);
  border: 1px solid var(--line-strong, var(--line));
  box-shadow: 0 24px 64px rgba(15, 23, 42, .28);
  padding: 20px;
  box-sizing: border-box;
  display: grid;
  gap: 16px;
  color: var(--ink);
}

.ta-sub-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.ta-sub-title-wrap {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.ta-sub-kicker {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: fit-content;
  padding: 3px 10px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  color: var(--accent);
  font-size: 11.5px;
  font-weight: 700;
}

.ta-sub-head h2 {
  margin: 0;
  font-size: clamp(18px, 2.2vw, 22px);
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.015em;
}

.ta-sub-sub {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.45;
}

.ta-sub-close-btn {
  flex: 0 0 auto;
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--ink-2);
  cursor: pointer;
  transition: background .15s, color .15s;
}

.ta-sub-close-btn:hover {
  background: var(--surface);
  color: var(--ink);
}

.ta-sub-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  align-items: stretch;
}

@media (max-width: 780px) {
  .ta-sub-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .ta-sub-modal {
    padding: 16px;
    border-radius: 16px;
  }
  .ta-limits-bar {
    flex-wrap: wrap;
    padding: 8px 10px;
  }
}

.ta-sub-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
  border-radius: 16px;
  background: var(--bg);
  border: 1px solid var(--line);
  box-sizing: border-box;
  transition: border-color .16s, box-shadow .16s;
}

.ta-sub-card.is-popular,
.ta-sub-card.is-highlight {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 4%, var(--surface));
  box-shadow: 0 8px 24px color-mix(in srgb, var(--accent) 12%, transparent);
}

.ta-sub-card.is-current {
  border-color: var(--confirm);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--confirm) 30%, transparent);
}

.ta-sub-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.ta-sub-card-name {
  font-size: 16px;
  font-weight: 700;
  color: var(--ink);
}

.ta-sub-card-badge {
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  background: var(--surface-2);
  color: var(--ink-2);
  border: 1px solid var(--line);
  white-space: nowrap;
}

.ta-sub-card.is-popular .ta-sub-card-badge {
  background: var(--accent);
  color: var(--accent-ink);
  border-color: var(--accent);
}

.ta-sub-card.is-current .ta-sub-card-badge {
  background: color-mix(in srgb, var(--confirm) 14%, transparent);
  color: var(--confirm);
  border-color: color-mix(in srgb, var(--confirm) 30%, transparent);
}

.ta-sub-price-row {
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.ta-sub-price {
  font-size: 26px;
  font-weight: 800;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}

.ta-sub-period {
  font-size: 12.5px;
  color: var(--muted);
}

.ta-sub-tagline {
  font-size: 12.5px;
  color: var(--ink-2);
  line-height: 1.4;
}

.ta-sub-features {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 7px;
  flex: 1 1 auto;
}

.ta-sub-features li {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  font-size: 12.5px;
  line-height: 1.38;
  color: var(--ink-2);
}

.ta-sub-features li svg {
  flex: 0 0 auto;
  margin-top: 2px;
  color: var(--confirm);
}

.ta-sub-buy-btn {
  width: 100%;
  min-height: 38px;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid var(--line-strong, var(--line));
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  transition: background .15s, border-color .15s, opacity .15s;
}

.ta-sub-card.is-popular .ta-sub-buy-btn,
.ta-sub-card.is-highlight .ta-sub-buy-btn {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
}

.ta-sub-buy-btn:hover:not(:disabled) {
  opacity: .92;
}

.ta-sub-buy-btn:disabled {
  opacity: .65;
  cursor: default;
}

.ta-sub-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
  font-size: 12px;
  color: var(--muted);
}

.ta-sub-free-reset {
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--ink-2);
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: 8px;
  cursor: pointer;
}

.ta-sub-free-reset:hover:not(:disabled) {
  color: var(--ink);
  border-color: var(--line-strong, var(--line));
}

.ta-drop-overlay {
  position: absolute;
  inset: 0;
  z-index: 25;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px 14px;
  border-radius: inherit;
  border: 1.5px dashed color-mix(in srgb, var(--accent) 72%, transparent);
  background: color-mix(in srgb, var(--surface) 92%, var(--accent-soft));
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-sizing: border-box;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity .15s ease, visibility .15s ease;
}

.ta-open-chat.is-drop-over .ta-drop-overlay {
  opacity: 1;
  visibility: visible;
}

.ta-drop-overlay-card {
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 100%;
  text-align: left;
}

.ta-drop-overlay-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.ta-drop-overlay-card b {
  font-size: 13.5px;
  font-weight: 700;
  line-height: 1.25;
  color: var(--ink);
}

.ta-drop-overlay-card span {
  font-size: 11.5px;
  line-height: 1.25;
  color: var(--muted);
}

.ta-drop-overlay-ico {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  color: var(--accent);
  flex: none;
}

.ta-drop-overlay-ico svg {
  width: 18px;
  height: 18px;
}

.ta-open-chat.is-drop-over .ta-ag-composer {
  border-color: transparent;
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.ta-open-chat.is-drop-over .ta-ag-composer-shell {
  border-color: color-mix(in srgb, var(--accent) 60%, var(--line));
}

#ta-project-form.is-drop-over {
  border-color: color-mix(in srgb, var(--accent) 65%, transparent);
  background: color-mix(in srgb, var(--accent) 7%, var(--surface));
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 16%, transparent);
}

:root[data-theme="dark"] .ta-drop-overlay {
  background: color-mix(in srgb, var(--surface) 94%, var(--accent-soft));
}

.ta-proj-group.is-dragging,
.ta-proj-chat-row.is-dragging,
.ta-rail-row.is-dragging {
  opacity: .42;
}

.ta-rail-scroll.is-dragging-rail {
  user-select: none;
}

.ta-proj-group,
.ta-proj-chat-row,
.ta-rail-row {
  position: relative;
}

.ta-proj-group.is-drop-before::before,
.ta-proj-chat-row.is-drop-before::before,
.ta-rail-row.is-drop-before::before {
  content: "";
  position: absolute;
  left: 6px;
  right: 6px;
  top: -2px;
  height: 2px;
  border-radius: 2px;
  background: var(--accent);
  pointer-events: none;
  z-index: 20;
}

.ta-proj-group.is-drop-after::after,
.ta-proj-chat-row.is-drop-after::after,
.ta-rail-row.is-drop-after::after {
  content: "";
  position: absolute;
  left: 6px;
  right: 6px;
  bottom: -2px;
  height: 2px;
  border-radius: 2px;
  background: var(--accent);
  pointer-events: none;
  z-index: 20;
}

.ta-proj-folder-row.is-drop-target {
  background: color-mix(in srgb, var(--accent) 12%, var(--surface-2));
  box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--accent) 65%, transparent);
}

.ta-proj-ungrouped.is-empty-drop {
  display: none;
  margin-top: 8px;
  padding: 10px 8px;
  border-radius: 10px;
  border: 1.5px dashed var(--line-strong, var(--line));
  text-align: center;
}

.ta-proj-tree-scroll.is-dragging-work-chat .ta-proj-ungrouped.is-empty-drop {
  display: flex;
}

.ta-proj-ungrouped.is-drop-target {
  border-radius: 10px;
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--accent) 55%, transparent);
}

.ta-drag-ghost {
  position: fixed;
  z-index: 9999;
  pointer-events: none;
  max-width: 220px;
  padding: 6px 11px;
  border-radius: 9px;
  border: 1px solid color-mix(in srgb, var(--accent) 45%, var(--line));
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  backdrop-filter: blur(10px);
  color: var(--ink);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  box-shadow: 0 10px 26px rgba(15, 23, 42, .18);
}

:root[data-theme="dark"] .ta-drag-ghost {
  background: color-mix(in srgb, var(--surface-2) 95%, transparent);
  box-shadow: 0 12px 30px rgba(0, 0, 0, .5);
}
