.s-studio-page,
.s-studio-page body {
  --bg: #050507;
  --bg-1: #0a0a0d;
  --bg-2: #0c0c10;
  --surface: #0e0e12;
  --surface-hi: #14141a;
  --border: rgba(255, 255, 255, 0.06);
  --border-hi: rgba(255, 255, 255, 0.1);
  --text: #fff;
  --text-dim: #a3a3aa;
  --text-mut: #7f7f89;
  --accent: #3b82f6;
  --accent-hi: #7fb8ff;
  --accent-soft: rgba(59, 130, 246, 0.12);
  --accent-solid: #2563eb;
  --accent-solid-hi: #1d4fd8;
  --ok: #4ade80;
  --warn: #facc15;
  --err: #f87171;
  --radius: 14px;
  --radius-sm: 11px;
  --radius-lg: 18px;
  --radius-chip: 9px;
  --radius-pill: 26px;
  --col: 768px;
  --tr: 180ms cubic-bezier(0.4, 0, 0.2, 1);
}

.s-studio-page *,
.s-studio-page *::before,
.s-studio-page *::after {
  box-sizing: border-box;
}

.s-studio-page,
.s-studio-page body {
  position: fixed;
  inset: 0;
  overflow: hidden;
  overscroll-behavior: none;
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Inter', 'SF Pro Display', 'Tokenator Segoe', 'Segoe UI', Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.s-studio-page button,
.s-studio-page input,
.s-studio-page select,
.s-studio-page textarea {
  font-family: inherit;
}

.s-studio-page :focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.28);
}

.tks-shell {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  height: 100vh;
  height: 100dvh;
  max-width: 100%;
  overflow: hidden;
  position: relative;
}

.tks-side,
.tks-main {
  position: relative;
  z-index: 1;
}

.tks-side {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px 10px 10px;
  border-right: 1px solid var(--border);
  background: var(--bg-1);
  height: 100%;
  overflow: hidden;
  min-height: 0;
}

.tks-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 40px;
  padding: 0 8px;
  border-radius: 10px;
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.2px;
  text-decoration: none;
  transition: background var(--tr);
}

.tks-brand:hover {
  background: rgba(255, 255, 255, 0.04);
}

.tks-brand-mark {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  flex: none;
  display: inline-flex;
}

.tks-brand-mark svg {
  width: 26px;
  height: 26px;
  border-radius: 8px;
}

.tks-brand-text b {
  font-weight: 600;
  color: var(--text-dim);
}

.tks-modes {
  display: flex;
  gap: 3px;
  padding: 3px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.02);
}

.tks-modes button {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-width: 0;
  height: 32px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text-mut);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background var(--tr), color var(--tr);
}

.tks-modes button svg {
  flex: none;
  width: 14px;
  height: 14px;
}

.tks-modes button:hover {
  color: var(--text);
}

.tks-modes button.active {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
}

@supports (text-box: trim-both cap alphabetic) {
  .tks-modes button > span {
    padding-block: calc((1lh - 1cap) / 2);
    text-box: trim-both cap alphabetic;
  }
}

.tks-new {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 38px;
  padding: 0 12px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  color: #fff;
  font-size: 13.5px;
  font-weight: 600;
  box-shadow: 0 6px 18px rgba(37, 99, 235, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.12);
  cursor: pointer;
  transition: filter var(--tr), box-shadow var(--tr), transform var(--tr);
}

.tks-new svg {
  flex: none;
  color: #fff;
}

.tks-new:hover {
  filter: brightness(1.08);
  box-shadow: 0 8px 22px rgba(37, 99, 235, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.14);
}

.tks-new:active {
  transform: translateY(1px);
}

.tks-side-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 10px 4px;
  font-size: 11.5px;
  font-weight: 500;
  color: var(--text-mut);
}

.tks-side-count {
  min-width: 18px;
  height: 18px;
  padding: 0 6px;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-dim);
  font-size: 11px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-variant-numeric: tabular-nums;
}

.tks-chats {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 0 2px 6px 0;
}

.tks-chats-empty {
  flex: 1;
  min-height: 160px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 0 10px;
  padding: 0 0 48px;
  text-align: center;
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--text-mut);
}

.tks-chats-empty svg {
  width: 26px;
  height: 26px;
  color: var(--text-dim);
  opacity: 0.55;
}

.tks-chat {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  padding: 0 6px 0 10px;
  border-radius: 10px;
  color: var(--text-dim);
  font-size: 13.5px;
  cursor: pointer;
  user-select: none;
  transition: background var(--tr), color var(--tr);
}

.tks-chat:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
}

.tks-chat.active {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
}

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

.tks-chat-acts {
  display: inline-flex;
  gap: 2px;
  opacity: 0;
  transition: opacity var(--tr);
}

.tks-chat:hover .tks-chat-acts,
.tks-chat.active .tks-chat-acts,
.tks-chat:focus-within .tks-chat-acts {
  opacity: 1;
}

.tks-chat-act {
  width: 26px;
  height: 26px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--text-mut);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background var(--tr), color var(--tr);
}

.tks-chat-act svg {
  width: 13px;
  height: 13px;
}

.tks-chat-act:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
}

.tks-chat-act.danger:hover {
  color: var(--err);
}

.tks-side-foot {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}

.tks-keycard {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.02);
  overflow: hidden;
}

.tks-key-row {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 38px;
  padding: 0 6px 0 10px;
  color: var(--text-mut);
  font-size: 12.5px;
  border-bottom: 1px solid var(--border);
}

.tks-key-row > svg {
  width: 14px;
  height: 14px;
  flex: none;
  color: var(--accent-hi);
}

.tks-key-masked {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tks-side-nav {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
}

.tks-side-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 38px;
  border: 0;
  border-left: 1px solid var(--border);
  background: transparent;
  color: var(--text-dim);
  text-decoration: none;
  cursor: pointer;
  transition: background var(--tr), color var(--tr);
}

.tks-side-btn:first-child {
  border-left: 0;
}

.tks-side-btn svg {
  width: 16px;
  height: 16px;
  flex: none;
}

.tks-side-btn:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
}

.tks-side-btn.dash {
  color: var(--accent-hi);
}

.tks-side-btn.dash:hover {
  background: rgba(59, 130, 246, 0.12);
}

.tks-side-btn.acct {
  color: #b79cff;
}

.tks-side-btn.help {
  color: #f87171;
}

.tks-side-btn.help:hover {
  background: rgba(248, 113, 113, 0.12);
}

.tks-side-btn.acct:hover {
  background: rgba(139, 92, 246, 0.14);
}

.tks-side-btn.cfg {
  color: #7dd3c0;
}

.tks-side-btn.cfg:hover {
  color: #9ceada;
  background: rgba(125, 211, 192, 0.14);
}

.tks-dialog.tks-settings {
  position: relative;
  max-width: 520px;
}

.tks-settings-x {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text-mut);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background var(--tr), color var(--tr);
}

.tks-settings-x svg {
  width: 15px;
  height: 15px;
}

.tks-settings-x:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.07);
}

.tks-overlay.tks-settings-overlay {
  z-index: 190;
}

.tks-settings-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 16px 0 2px;
}

.tks-settings-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 140px;
  align-items: center;
  gap: 14px;
  min-height: 72px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.02);
}

.tks-settings-text {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.tks-settings-name {
  color: var(--text);
  font-size: 13.5px;
  font-weight: 500;
}

.tks-settings-hint {
  color: var(--text-mut);
  font-size: 11.5px;
  line-height: 1.35;
}

.tks-wipe {
  width: 100%;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 12px;
  border: 1px solid rgba(248, 113, 113, 0.26);
  border-radius: 10px;
  background: rgba(248, 113, 113, 0.1);
  color: #fca5a5;
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: background var(--tr), border-color var(--tr), color var(--tr);
}

.tks-wipe svg {
  width: 14px;
  height: 14px;
  flex: none;
}

.tks-wipe:hover:not(:disabled) {
  background: rgba(248, 113, 113, 0.2);
  border-color: rgba(248, 113, 113, 0.45);
  color: #fee2e2;
}

.tks-wipe:active:not(:disabled) {
  background: rgba(248, 113, 113, 0.26);
}

.tks-wipe:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(248, 113, 113, 0.28);
}

.tks-wipe.empty,
.tks-wipe:disabled {
  border-color: var(--border);
  background: transparent;
  color: var(--text-mut);
  font-weight: 500;
  cursor: not-allowed;
}

.tks-dialog-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

@media (max-width: 520px) {
  .tks-settings-row {
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
  }
}

.tks-side-btn.out {
  color: #f19a9a;
}

.tks-side-btn.out:hover {
  color: var(--err);
  background: rgba(248, 113, 113, 0.12);
}

.tks-tools .tks-think-body {
  gap: 10px;
}

.tks-tools-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
  white-space: normal;
}

.tks-tool-step {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.tks-tool-head {
  color: var(--text-dim);
  font-size: 12.5px;
  font-weight: 500;
}

.tks-tool-error {
  color: var(--err);
  font-size: 12.5px;
  overflow-wrap: anywhere;
}

.tks-tool-hit {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.02);
  text-decoration: none;
  transition: border-color var(--tr), background var(--tr);
}

.tks-tool-hit:hover {
  border-color: var(--border-hi);
  background: rgba(255, 255, 255, 0.045);
}

.tks-tool-hit-title {
  color: var(--text);
  font-size: 12.5px;
  font-weight: 500;
}

.tks-tool-hit-url {
  color: var(--accent-hi);
  font-size: 11.5px;
  overflow-wrap: anywhere;
}

.tks-tool-hit-text {
  color: var(--text-mut);
  font-size: 11.5px;
  line-height: 1.4;
}

.tks-tooltip {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 10000;
  width: max-content;
  max-width: min(260px, calc(100vw - 16px));
  padding: 5px 9px;
  border-radius: 8px;
  border: 1px solid var(--border-hi);
  background: var(--surface-hi);
  color: var(--text);
  font-size: 11.5px;
  font-weight: 500;
  line-height: 1.3;
  white-space: normal;
  overflow-wrap: anywhere;
  text-align: center;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transform: translateY(4px);
  box-shadow: 0 10px 26px -12px rgba(0, 0, 0, 0.8);
  transition: opacity var(--tr), transform var(--tr), visibility 0s linear 180ms;
}

.tks-tooltip.below {
  transform: translateY(-4px);
}

.tks-tooltip.show {
  opacity: 1;
  visibility: visible;
  transform: none;
  transition: opacity var(--tr), transform var(--tr), visibility 0s;
}

.tks-acts {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-top: -2px;
  min-height: 28px;
}

.tks-when {
  margin-right: 6px;
  font-size: 12px;
  color: var(--text-mut);
  font-variant-numeric: tabular-nums;
}

.tks-act {
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text-mut);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background var(--tr), color var(--tr);
}

.tks-act svg {
  width: 15px;
  height: 15px;
}

.tks-act:hover {
  background: rgba(255, 255, 255, 0.07);
  color: var(--text);
}

.tks-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  height: 100%;
  overflow: hidden;
  background: var(--bg);
}

.tks-top {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 56px;
  padding: 8px 14px;
  position: sticky;
  top: 0;
  z-index: 5;
  background: var(--bg);
}

.tks-topup {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 36px;
  padding: 0 13px;
  border-radius: 10px;
  border: 1px solid rgba(74, 222, 128, 0.16);
  background: rgba(74, 222, 128, 0.06);
  color: #4ade80;
  font-size: 12.5px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  flex: none;
  transition: background var(--tr), border-color var(--tr), color var(--tr);
}

.tks-topup svg {
  width: 14px;
  height: 14px;
  flex: none;
}

.tks-topup:hover {
  background: rgba(74, 222, 128, 0.12);
  border-color: rgba(74, 222, 128, 0.3);
  color: #86efac;
}

.tks-topup-wide {
  width: 100%;
  height: 38px;
  margin-top: 2px;
}

.tks-burger {
  display: none;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-dim);
  border-radius: 10px;
  width: 36px;
  height: 36px;
  cursor: pointer;
  flex: none;
}

.tks-top-title {
  flex: 1;
  min-width: 0;
  font-size: 13.5px;
  color: var(--text-mut);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tks-scroll {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  min-height: 0;
  padding: 8px 16px 0;
}

.tks-thread {
  max-width: var(--col);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 26px;
  padding: 22px 0 44px;
}

.tks-msg {
  display: flex;
  flex-direction: column;
  gap: 8px;
  animation: tks-fade 200ms cubic-bezier(0.4, 0, 0.2, 1) both;
}

.tks-msg.user {
  align-items: flex-end;
}

.tks-bubble {
  font-size: 15.5px;
  line-height: 1.7;
  color: #ececf1;
  overflow-wrap: anywhere;
}

.tks-msg.user .tks-bubble {
  max-width: 72%;
  border-radius: 22px;
  padding: 10px 16px;
  background: rgba(255, 255, 255, 0.07);
  color: var(--text);
  white-space: pre-wrap;
  font-size: 15px;
  line-height: 1.6;
}

.tks-who {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: var(--text-mut);
}

.tks-who-mark {
  width: 22px;
  height: 22px;
  border-radius: 7px;
  background: linear-gradient(135deg, #3b82f6, #0055cc);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
}

.tks-who-mark svg {
  width: 13px;
  height: 13px;
}

.tks-effort {
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 1px 8px;
  font-size: 11px;
  color: var(--text-mut);
}

.tks-bubble p {
  margin: 0 0 12px;
}

.tks-bubble p:last-child {
  margin-bottom: 0;
}

.tks-bubble h1,
.tks-bubble h2,
.tks-bubble h3,
.tks-bubble h4,
.tks-bubble h5,
.tks-bubble h6 {
  margin: 20px 0 8px;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.2px;
  color: var(--text);
}

.tks-bubble h1:first-child,
.tks-bubble h2:first-child,
.tks-bubble h3:first-child {
  margin-top: 0;
}

.tks-bubble ul,
.tks-bubble ol {
  margin: 0 0 12px;
  padding-left: 22px;
}

.tks-bubble li {
  margin: 5px 0;
}

.tks-bubble li::marker {
  color: var(--text-mut);
}

.tks-bubble blockquote {
  margin: 0 0 12px;
  padding: 4px 14px;
  border-left: 2px solid rgba(255, 255, 255, 0.16);
  color: var(--text-dim);
}

.tks-bubble hr {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 16px 0;
}

.tks-bubble strong {
  color: var(--text);
  font-weight: 600;
}

.tks-bubble code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 13.2px;
  background: rgba(255, 255, 255, 0.07);
  border-radius: 6px;
  padding: 2px 6px;
}

.tks-bubble a {
  color: var(--accent-hi);
  text-decoration: underline;
  text-decoration-color: rgba(127, 184, 255, 0.35);
  text-underline-offset: 2px;
}

.tks-bubble a:hover {
  text-decoration-color: var(--accent-hi);
}

.tks-code {
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  margin: 4px 0 14px;
  background: var(--bg-1);
}

.tks-code-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 8px 7px 14px;
  background: rgba(255, 255, 255, 0.025);
  font-size: 12px;
  color: var(--text-mut);
}

.tks-code pre {
  margin: 0;
  padding: 14px;
  overflow-x: auto;
}

.tks-code code {
  background: transparent;
  padding: 0;
  font-size: 13px;
  line-height: 1.6;
}

.tks-copy {
  border: 0;
  background: transparent;
  color: var(--text-mut);
  border-radius: 7px;
  padding: 4px 9px;
  font-size: 12px;
  cursor: pointer;
  transition: color var(--tr), background var(--tr);
}

.tks-copy:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
}

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

.tks-msg.user .tks-files {
  align-self: flex-end;
  justify-content: flex-end;
}

.tks-file {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
  border-radius: 12px;
  padding: 7px 11px;
  font-size: 12.5px;
  color: var(--text-dim);
  text-decoration: none;
  max-width: 260px;
  cursor: pointer;
  transition: border-color var(--tr), color var(--tr), background var(--tr);
}

.tks-file:hover {
  color: var(--text);
  border-color: var(--border-hi);
  background: rgba(255, 255, 255, 0.05);
}

.tks-file span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tks-img {
  display: block;
  max-width: min(100%, 420px);
  border-radius: 14px;
  border: 1px solid var(--border);
}

.tks-think {
  align-self: flex-start;
  max-width: 100%;
  font-size: 13px;
  color: var(--text-mut);
}

.tks-think summary {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 168px;
  cursor: pointer;
  list-style: none;
  color: var(--text-mut);
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.02);
  border-radius: 20px;
  padding: 5px 12px;
  transition: color var(--tr), border-color var(--tr), background var(--tr);
}

.tks-think summary::-webkit-details-marker {
  display: none;
}

.tks-think summary:hover {
  color: var(--text-dim);
  border-color: var(--border-hi);
  background: rgba(255, 255, 255, 0.04);
}

.tks-think-chev {
  width: 14px;
  height: 14px;
  transition: transform var(--tr);
}

.tks-think[open] .tks-think-chev {
  transform: rotate(180deg);
}

.tks-think-body {
  margin-top: 10px;
  padding: 2px 0 2px 14px;
  border-left: 2px solid var(--border-hi);
  white-space: pre-wrap;
  line-height: 1.65;
  color: var(--text-mut);
}

.tks-err {
  border: 1px solid rgba(248, 113, 113, 0.28);
  background: rgba(248, 113, 113, 0.08);
  color: #fca5a5;
  border-radius: 12px;
  padding: 10px 14px;
  font-size: 13.5px;
  line-height: 1.5;
}

.tks-wait {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 26px;
  color: var(--text-mut);
  font-size: 13px;
}

.tks-wait-label {
  color: var(--text-mut);
  font-size: 13.5px;
  animation: tks-breathe 1.6s ease-in-out infinite;
}

@keyframes tks-breathe {
  0%,
  100% {
    opacity: 0.55;
  }
  50% {
    opacity: 1;
  }
}

.tks-spinner {
  width: 12px;
  height: 12px;
  flex: none;
  border-radius: 50%;
  background: var(--text);
  display: inline-block;
  animation: tks-pulse 1.1s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

.tks-empty {
  animation: tks-fade 260ms cubic-bezier(0.4, 0, 0.2, 1) both;
  max-width: var(--col);
  margin: 0 auto 22px;
  text-align: center;
  color: var(--text-mut);
}

.tks-empty-head {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}

.tks-empty-mark {
  display: inline-flex;
  width: 46px;
  height: 46px;
}

.tks-empty-mark svg {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  box-shadow: 0 14px 40px -14px rgba(59, 130, 246, 0.7);
}

.tks-empty h1 {
  font-size: 30px;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 8px;
  letter-spacing: -0.7px;
  line-height: 1.15;
}

.tks-empty p {
  font-size: 14px;
  line-height: 1.6;
  margin: 0 auto;
  max-width: 460px;
}

.tks-shell.is-empty .tks-scroll {
  flex: 0 0 auto;
  margin-top: auto;
  overflow: visible;
}

.tks-shell.is-empty .tks-main > :last-child {
  margin-bottom: auto;
}

.tks-composer {
  padding: 6px 16px 12px;
  background: linear-gradient(180deg, rgba(5, 5, 7, 0) 0%, var(--bg) 42%);
}

.tks-composer-inner {
  max-width: var(--col);
  margin: 0 auto;
}

.tks-box {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px 12px 10px 16px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: var(--radius-pill);
  background: var(--surface-hi);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.03) inset, 0 18px 48px -30px rgba(0, 0, 0, 0.9);
  transition: border-color var(--tr), box-shadow var(--tr);
}

.tks-hold {
  flex-direction: row;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  color: var(--text-dim);
  font-size: 13.5px;
  line-height: 1.4;
}

.tks-hold-text {
  flex: 1 1 auto;
  min-width: 0;
}

.tks-hold-open {
  flex: none;
  height: 32px;
  padding: 0 14px;
  border-radius: 20px;
  border: 1px solid var(--border-hi);
  background: transparent;
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background var(--tr), border-color var(--tr);
}

.tks-hold-open:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.18);
}

@media (max-width: 520px) {
  .tks-hold {
    flex-wrap: wrap;
  }

  .tks-hold-open {
    width: 100%;
  }
}

.tks-box:focus-within {
  border-color: rgba(59, 130, 246, 0.45);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.03) inset, 0 0 0 3px rgba(59, 130, 246, 0.14),
    0 18px 48px -30px rgba(0, 0, 0, 0.9);
}

.tks-box textarea {
  width: 100%;
  min-height: 28px;
  max-height: 200px;
  resize: none;
  border: 0;
  outline: none;
  background: transparent;
  color: var(--text);
  font-size: 15.5px;
  line-height: 1.55;
  padding: 2px 0;
  box-shadow: none;
}

.tks-box textarea::placeholder {
  color: var(--text-mut);
}

.tks-box textarea:focus,
.tks-box textarea:focus-visible {
  outline: none;
  box-shadow: none;
}

.tks-controls {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.tks-controls-right {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.tks-icon-btn {
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-dim);
  border-radius: 50%;
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex: none;
  transition: background var(--tr), color var(--tr), border-color var(--tr);
}

.tks-icon-btn:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
}

.tks-attach-btn.off,
.tks-attach-btn.off:hover {
  color: var(--text-mut);
  background: transparent;
  opacity: 0.45;
  cursor: not-allowed;
}

.tks-toggle {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 32px;
  padding: 0 12px;
  border-radius: 20px;
  border: 1px solid var(--border-hi);
  background: transparent;
  color: var(--text-dim);
  font-size: 13px;
  font-weight: 500;
  line-height: 1;
  cursor: pointer;
  transition: border-color var(--tr), background var(--tr), color var(--tr);
}

.tks-toggle svg {
  width: 14px;
  height: 14px;
  flex: none;
}

.tks-toggle:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
}

.tks-toggle.on {
  border-color: rgba(59, 130, 246, 0.4);
  background: var(--accent-soft);
  color: var(--accent-hi);
}

.tks-select {
  position: relative;
  display: inline-flex;
}

.tks-select-trigger {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 11px 0 12px;
  border-radius: 20px;
  border: 1px solid var(--border-hi);
  background: transparent;
  color: var(--text-dim);
  font-size: 13px;
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  transition: border-color var(--tr), color var(--tr), background var(--tr);
}

.tks-select-prefix {
  color: var(--text-mut);
}

.tks-select-trigger svg {
  width: 9px;
  height: 9px;
  flex: none;
  color: var(--text-mut);
  transition: transform var(--tr);
}

.tks-select-trigger:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
}

.tks-select.open .tks-select-trigger {
  color: var(--text);
  background: var(--surface-hi);
  position: relative;
  z-index: 41;
}

.tks-select.open .tks-select-trigger svg {
  transform: rotate(180deg);
}

.tks-select-menu {
  position: absolute;
  top: calc(100% + 7px);
  left: 0;
  min-width: 100%;
  max-height: 232px;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 1px;
  border: 1px solid var(--border-hi);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: 0 18px 44px -16px rgba(0, 0, 0, 0.8);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: opacity 150ms linear, visibility 150ms step-end, transform 150ms cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 40;
}

.tks-select.open .tks-select-menu {
  opacity: 1;
  visibility: visible;
  transform: none;
  transition: opacity 150ms linear, visibility 0s, transform 150ms cubic-bezier(0.4, 0, 0.2, 1);
}

.tks-select.up .tks-select-menu {
  top: auto;
  bottom: calc(100% + 7px);
  transform: translateY(4px);
}

.tks-select.up.open .tks-select-menu {
  transform: none;
}

.tks-select-menu button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 8px 10px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--text-dim);
  font-size: 13px;
  white-space: nowrap;
  text-align: left;
  cursor: pointer;
  transition: background var(--tr), color var(--tr);
}

.tks-select-menu button:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
}

.tks-select-menu button.active {
  color: var(--text);
}

.tks-select-menu button svg {
  width: 13px;
  height: 13px;
  flex: none;
  color: var(--accent-hi);
}

.tks-send {
  width: 36px;
  height: 36px;
  border-color: transparent;
  background: var(--accent-solid);
  color: #fff;
  box-shadow: 0 6px 16px -8px rgba(37, 99, 235, 0.7);
}

.tks-send:hover {
  background: var(--accent-solid-hi);
  color: #fff;
}

.tks-send:disabled {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-mut);
  box-shadow: none;
  cursor: default;
}

.tks-stop {
  width: 36px;
  height: 36px;
  background: rgba(255, 255, 255, 0.1);
  color: var(--text);
}

.tks-stop:hover {
  background: rgba(255, 255, 255, 0.16);
}

.tks-pending {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-bottom: 4px;
}

.tks-attach {
  position: relative;
  display: inline-flex;
  align-items: center;
  max-width: 260px;
  border: 1px solid var(--border-hi);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  overflow: visible;
}

.tks-attach.image {
  width: 72px;
  height: 72px;
  padding: 0;
}

.tks-attach.image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 12px;
  display: block;
}

.tks-attach-doc {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 30px 8px 10px;
  font-size: 12.5px;
  color: var(--text-dim);
  max-width: 100%;
}

.tks-attach-doc svg {
  width: 15px;
  height: 15px;
  flex: none;
  color: var(--text-mut);
}

.tks-attach-doc span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tks-attach-x {
  position: absolute;
  top: -7px;
  right: -7px;
  width: 22px;
  height: 22px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid var(--border-hi);
  background: var(--surface-hi);
  color: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  max-width: none;
}

.tks-attach-x svg {
  width: 11px;
  height: 11px;
}

.tks-attach-x:hover {
  background: var(--err);
  border-color: var(--err);
  color: #fff;
}

.tks-attach:not(.image) .tks-attach-x {
  top: 50%;
  right: 6px;
  transform: translateY(-50%);
  border: 0;
  background: transparent;
  color: var(--text-mut);
}

.tks-attach:not(.image) .tks-attach-x:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
}

.tks-split {
  display: inline-flex;
  align-items: stretch;
}

.tks-split.on .tks-toggle {
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
  border-right-color: transparent;
}

.tks-split.on .tks-select-trigger {
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
  border-color: rgba(59, 130, 246, 0.4);
  background: var(--accent-soft);
  color: var(--accent-hi);
  padding-left: 10px;
}

.tks-split.on .tks-select-trigger svg {
  color: var(--accent-hi);
}

.tks-split.on .tks-select.open .tks-select-trigger,
.tks-split.on .tks-select-trigger:hover {
  background: rgba(59, 130, 246, 0.2);
  color: #fff;
}

.tks-note {
  margin-top: 9px;
  font-size: 11.5px;
  color: #6b6b74;
  text-align: center;
}

.tks-note.warn {
  color: var(--warn);
}

.tks-meters {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.tks-meter {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 112px;
  height: 36px;
  justify-content: center;
  padding: 0 11px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.02);
  cursor: default;
  outline: none;
  transition: border-color var(--tr), background var(--tr);
}

.tks-meter:hover,
.tks-meter:focus-visible {
  border-color: var(--border-hi);
  background: rgba(255, 255, 255, 0.04);
  box-shadow: none;
}

.tks-meter-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  font-size: 11px;
  color: var(--text-mut);
  line-height: 1;
}

.tks-meter-head strong {
  font-size: 12px;
  font-weight: 600;
  color: var(--accent-hi);
  font-variant-numeric: tabular-nums;
}

.tks-meter.warn .tks-meter-head strong {
  color: var(--warn);
}

.tks-meter.bad .tks-meter-head strong {
  color: var(--err);
}

.tks-meter-track {
  display: block;
  height: 3px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.tks-meter-fill {
  display: block;
  height: 100%;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--accent), var(--accent-hi));
  transition: width 320ms cubic-bezier(0.4, 0, 0.2, 1), background 200ms linear;
}

.tks-meter.warn .tks-meter-fill {
  background: linear-gradient(90deg, #b45309, var(--warn));
}

.tks-meter.bad .tks-meter-fill {
  background: linear-gradient(90deg, #991b1b, var(--err));
}

.tks-meter-card {
  position: fixed;
  top: 0;
  right: 0;
  min-width: 250px;
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: 12px 14px 13px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 14px;
  background: linear-gradient(180deg, var(--surface-hi) 0%, var(--surface) 100%);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.03) inset, 0 22px 50px -18px rgba(0, 0, 0, 0.85);
  font-size: 12.5px;
  color: var(--text-mut);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: opacity 150ms linear, visibility 150ms step-end, transform 150ms cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 10000;
}

.tks-meter-card.open {
  opacity: 1;
  visibility: visible;
  transform: none;
  transition: opacity 150ms linear, visibility 0s, transform 150ms cubic-bezier(0.4, 0, 0.2, 1);
}

.tks-meter-card-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
}

.tks-meter-card-head strong {
  color: var(--accent-hi);
  font-variant-numeric: tabular-nums;
}

.tks-meter-card.warn .tks-meter-card-head strong {
  color: var(--warn);
}

.tks-meter-card.bad .tks-meter-card-head strong {
  color: var(--err);
}

.tks-meter-card.warn .tks-meter-fill {
  background: linear-gradient(90deg, #b45309, var(--warn));
}

.tks-meter-card.bad .tks-meter-fill {
  background: linear-gradient(90deg, #991b1b, var(--err));
}

.tks-meter-card-track {
  display: block;
  height: 4px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
  margin-bottom: 4px;
}

.tks-meter-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  white-space: nowrap;
  padding-top: 7px;
  border-top: 1px solid var(--border);
}

.tks-meter-row b {
  color: var(--text);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.tks-picker {
  position: relative;
}

.tks-picker-trigger {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 36px;
  max-width: 260px;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: var(--text);
  font-size: 14.5px;
  font-weight: 600;
  letter-spacing: -0.2px;
  cursor: pointer;
  transition: background var(--tr), color var(--tr);
}

.tks-picker-trigger span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tks-picker-trigger .tks-picker-chev {
  width: 10px;
  height: 10px;
  flex: none;
  color: var(--text-mut);
  transition: transform var(--tr), color var(--tr);
}

.tks-picker.open .tks-picker-trigger,
.tks-picker-trigger:hover {
  background: rgba(255, 255, 255, 0.06);
}

.tks-picker.locked .tks-picker-trigger {
  cursor: default;
  background: transparent;
  color: var(--text-dim);
}

.tks-picker.locked .tks-picker-trigger .tks-picker-chev {
  opacity: 0.35;
}

.tks-picker-trigger:hover .tks-picker-chev {
  color: var(--text-dim);
}

.tks-picker.open .tks-picker-trigger .tks-picker-chev {
  transform: rotate(180deg);
}

.tks-picker-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 320px;
  max-height: 420px;
  overflow: hidden;
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 1px;
  border: 1px solid var(--border-hi);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: 0 20px 48px -18px rgba(0, 0, 0, 0.85);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: opacity 150ms linear, visibility 150ms step-end, transform 150ms cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 40;
}

.tks-picker.open .tks-picker-menu {
  opacity: 1;
  visibility: visible;
  transform: none;
  transition: opacity 150ms linear, visibility 0s, transform 150ms cubic-bezier(0.4, 0, 0.2, 1);
}

.tks-picker.up .tks-picker-menu {
  top: auto;
  bottom: calc(100% + 6px);
}

.tks-picker-list {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.tks-picker-list button {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--text-dim);
  text-align: left;
  cursor: pointer;
  flex: none;
  transition: background var(--tr), color var(--tr);
}

.tks-picker-list button:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
}

.tks-picker-list button.active {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
}

.tks-picker-list button.off {
  cursor: not-allowed;
  opacity: 0.45;
}

.tks-picker-list button.off:hover {
  background: transparent;
  color: var(--text-dim);
}

.tks-picker-tools {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 2px 2px 8px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 6px;
}

.tks-picker-search {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 34px;
  padding: 0 8px;
  border-radius: 9px;
  color: var(--text-mut);
  transition: color var(--tr);
}

.tks-picker-search:focus-within {
  color: var(--text-dim);
}

.tks-picker-search svg {
  width: 14px;
  height: 14px;
  flex: none;
}

.tks-picker-search input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: none;
  background: transparent;
  color: var(--text);
  font-size: 13px;
  padding: 0;
}

.tks-picker-search input::-webkit-search-cancel-button {
  -webkit-appearance: none;
}

.tks-picker-search input:focus,
.tks-picker-search input:focus-visible {
  outline: none;
  box-shadow: none;
}

.tks-picker-sort {
  display: flex;
  gap: 4px;
}

.tks-picker-sort button {
  flex: 1;
  height: 28px;
  white-space: nowrap;
  padding: 0 8px;
  border-radius: 8px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-mut);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: background var(--tr), color var(--tr), border-color var(--tr);
}

.tks-picker-sort button:hover:not(:disabled) {
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
}

.tks-picker-sort button.on {
  color: var(--text);
  background: rgba(255, 255, 255, 0.07);
  border-color: var(--border-hi);
}

.tks-picker-sort button:disabled {
  cursor: default;
  opacity: 0.4;
}

.tks-picker-group {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
  padding: 10px 10px 4px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-mut);
}

.tks-picker-group.free {
  color: var(--ok);
}

.tks-picker-group-note {
  font-weight: 500;
  font-size: 11px;
  line-height: 1.35;
  color: var(--text-mut);
}

.tks-picker-empty {
  padding: 14px 10px;
  font-size: 13px;
  color: var(--text-mut);
  text-align: center;
}

.tks-picker-free-now {
  flex: none;
}

.tks-picker-name {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  font-weight: 500;
}

.tks-picker-free {
  border: 1px solid rgba(74, 222, 128, 0.3);
  background: rgba(74, 222, 128, 0.08);
  color: var(--ok);
  border-radius: 20px;
  padding: 1px 7px;
  font-size: 10.5px;
  font-weight: 600;
}

.tks-picker-owner {
  font-size: 11.5px;
  color: var(--text-mut);
}

.tks-lang {
  position: relative;
}

.tks-lang-trigger {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  padding: 0 11px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.02);
  color: var(--text-dim);
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  transition: border-color var(--tr), color var(--tr), background var(--tr);
}

.tks-lang-trigger svg {
  width: 9px;
  height: 9px;
  transition: transform var(--tr);
}

.tks-lang.open .tks-lang-trigger,
.tks-lang-trigger:hover {
  border-color: var(--border-hi);
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
}

.tks-lang.open .tks-lang-trigger svg {
  transform: rotate(180deg);
}

.tks-lang-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 156px;
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 1px;
  border: 1px solid var(--border-hi);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: 0 18px 44px -16px rgba(0, 0, 0, 0.8);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: opacity 150ms linear, visibility 150ms step-end, transform 150ms cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 40;
}

.tks-lang.open .tks-lang-menu {
  opacity: 1;
  visibility: visible;
  transform: none;
  transition: opacity 150ms linear, visibility 0s, transform 150ms cubic-bezier(0.4, 0, 0.2, 1);
}

.tks-lang-menu button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--text-dim);
  font-size: 13px;
  cursor: pointer;
  transition: background var(--tr), color var(--tr);
}

.tks-lang-menu button:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
}

.tks-lang-menu button.active {
  color: var(--text);
}

.tks-lang-menu svg {
  width: 13px;
  height: 13px;
  color: var(--accent-hi);
}

.tks-gate {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  position: relative;
}

.tks-gate::before {
  content: '';
  position: fixed;
  top: -320px;
  left: calc(50% - 450px);
  width: 900px;
  height: 900px;
  border-radius: 50%;
  background: radial-gradient(circle at center, rgba(59, 130, 246, 0.12) 0%, rgba(59, 130, 246, 0.03) 42%, transparent 72%);
  filter: blur(60px);
  pointer-events: none;
}

.tks-gate-head {
  text-align: center;
  margin: 0 0 30px;
  position: relative;
}

.tks-gate-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
}

.tks-gate-brand svg {
  width: 36px;
  height: 36px;
  filter: drop-shadow(0 2px 6px rgba(0, 119, 255, 0.45));
}

.tks-gate-brand h1 {
  font-size: 28px;
  font-weight: 700;
  margin: 0;
  letter-spacing: -0.4px;
  line-height: 1.1;
}

.tks-gate-brand h1 span {
  color: var(--accent);
  font-weight: 600;
}

.tks-gate-head p {
  font-size: 15px;
  line-height: 1.5;
  color: var(--text-mut);
  margin: 10px 0 0;
}

.tks-gate-card {
  animation: tks-fade 240ms cubic-bezier(0.4, 0, 0.2, 1) both;
  width: 100%;
  max-width: 400px;
  border: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.024) 0%, rgba(255, 255, 255, 0.008) 100%);
  border-radius: var(--radius);
  padding: 18px;
  position: relative;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
}

.tks-gate-field {
  margin-bottom: 12px;
}

.tks-gate-card label {
  display: block;
  margin-bottom: 4px;
  font-size: 13px;
  color: var(--text-dim);
}

.tks-gate-card input {
  width: 100%;
  padding: 11px 13px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.025);
  color: #fff;
  font-size: 14px;
  transition: border-color var(--tr), background var(--tr), box-shadow var(--tr);
}

.tks-gate-card input::placeholder {
  color: var(--text-mut);
}

.tks-gate-card input:hover {
  border-color: rgba(255, 255, 255, 0.14);
}

.tks-gate-card input:focus {
  outline: none;
  border-color: rgba(59, 130, 246, 0.5);
  background: rgba(255, 255, 255, 0.045);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.16);
}

.tks-primary {
  width: 100%;
  padding: 9px 16px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  line-height: 1;
  background: #2563eb;
  color: #fff;
  box-shadow: 0 1px 3px rgba(37, 99, 235, 0.35);
  transition: background var(--tr), border-color var(--tr), box-shadow var(--tr), color var(--tr);
}

.tks-primary:hover {
  background: #1d4fd8;
  border-color: rgba(255, 255, 255, 0.1);
  box-shadow: 0 6px 18px -6px rgba(37, 99, 235, 0.6);
}

.tks-gate-lang {
  display: flex;
  justify-content: center;
  margin-top: 16px;
}

.tks-lang.plain .tks-lang-trigger {
  height: auto;
  padding: 4px 8px;
  gap: 5px;
  border-color: transparent;
  background: transparent;
  color: var(--text-mut);
  font-size: 12px;
}

.tks-lang.plain .tks-lang-trigger:hover,
.tks-lang.plain.open .tks-lang-trigger {
  color: var(--text);
  background: transparent;
  border-color: transparent;
}

.tks-lang-globe {
  width: 14px !important;
  height: 14px !important;
  transform: none !important;
}

.tks-lang.centered .tks-lang-menu {
  left: 50%;
  right: auto;
  transform: translate(-50%, -4px);
}

.tks-lang.centered.open .tks-lang-menu {
  transform: translate(-50%, 0);
}

.tks-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(2, 3, 7, 0.72);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.2s ease, visibility 0s linear 0.2s, backdrop-filter 0s linear 0.2s;
}

.tks-overlay.open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  backdrop-filter: blur(12px) saturate(1.2);
  -webkit-backdrop-filter: blur(12px) saturate(1.2);
  transition: opacity 0.2s ease, visibility 0s, backdrop-filter 0s;
}

.tks-dialog {
  width: 100%;
  max-width: 380px;
  padding: 22px 22px 20px;
  background: #0e0e12;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 16px;
  box-shadow: 0 26px 70px rgba(0, 0, 0, 0.6);
  transform: translateY(10px) scale(0.985);
  transition: transform 0.26s cubic-bezier(0.22, 1, 0.36, 1);
}

.tks-overlay.open .tks-dialog {
  transform: none;
}

.tks-dialog-title {
  font-size: 15px;
  font-weight: 600;
  color: #fff;
  margin-bottom: 8px;
}

.tks-dialog-text {
  font-size: 13px;
  color: #9a9aa4;
  line-height: 1.6;
  margin-bottom: 20px;
  overflow-wrap: anywhere;
}

.tks-dialog.prompt .tks-dialog-text {
  margin-bottom: 12px;
}

.tks-dialog input {
  width: 100%;
  margin-bottom: 20px;
  padding: 9px 11px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.025);
  color: var(--text);
  font-size: 13px;
  transition: border-color var(--tr), box-shadow var(--tr);
}

.tks-dialog input:focus {
  outline: none;
  border-color: rgba(59, 130, 246, 0.5);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.16);
}

.tks-dialog.wide {
  max-width: 640px;
}

.tks-dialog-label {
  margin-bottom: 6px;
  color: var(--text-mut);
  font-size: 11.5px;
  font-weight: 600;
}

.tks-dialog-area {
  width: 100%;
  min-height: 190px;
  margin-bottom: 8px;
  padding: 11px 12px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.025);
  color: var(--text);
  font: inherit;
  font-size: 13px;
  line-height: 1.55;
  resize: vertical;
  transition: border-color var(--tr), box-shadow var(--tr);
}

.tks-dialog-area:focus {
  outline: none;
  border-color: rgba(59, 130, 246, 0.5);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.16);
}

.tks-dialog-count {
  margin-bottom: 16px;
  color: var(--text-mut);
  font-size: 11.5px;
  text-align: right;
}

.tks-dialog-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.tks-dialog-btn {
  padding: 9px 15px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.04);
  color: #c9c9d1;
  font-family: inherit;
  font-size: 12.5px;
  cursor: pointer;
  transition: color 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.tks-dialog-btn:hover {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.07);
}

.tks-dialog-btn.primary {
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  border-color: transparent;
  color: #fff;
  font-weight: 600;
}

.tks-dialog-btn.primary:hover {
  filter: brightness(1.08);
}

.tks-dialog-btn.primary.danger {
  background: linear-gradient(135deg, #e5484d, #c2363b);
}

@media (max-width: 520px) {
  .tks-dialog {
    padding: 18px 16px 16px;
  }
}

.tks-backdrop {
  display: none;
}

@keyframes tks-spin {
  to {
    transform: rotate(360deg);
  }
}

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

@keyframes tks-pulse {
  0%,
  100% {
    transform: scale(0.86);
    opacity: 0.55;
  }
  50% {
    transform: scale(1);
    opacity: 1;
  }
}

@keyframes tks-pop {
  from {
    opacity: 0;
    transform: scale(0.94);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.s-studio-page ::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

.s-studio-page ::-webkit-scrollbar-track {
  background: transparent;
}

.s-studio-page ::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  border: 2px solid transparent;
  background-clip: padding-box;
}

.s-studio-page ::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.15);
  background-clip: padding-box;
  border: 2px solid transparent;
}

@media (max-width: 900px) {
  .tks-shell {
    grid-template-columns: minmax(0, 1fr);
  }

  .tks-side {
    position: fixed;
    top: 0;
    bottom: 0;
    left: -290px;
    width: 280px;
    height: 100%;
    z-index: 40;
    opacity: 0;
    visibility: hidden;
    box-shadow: none;
    transition: left 220ms cubic-bezier(0.4, 0, 0.2, 1), opacity 180ms linear, visibility 220ms step-end,
      box-shadow 220ms linear;
  }

  .tks-side.open {
    left: 0;
    opacity: 1;
    visibility: visible;
    box-shadow: 24px 0 60px -30px rgba(0, 0, 0, 0.9);
    transition: left 220ms cubic-bezier(0.4, 0, 0.2, 1), opacity 180ms linear, visibility 0s,
      box-shadow 220ms linear;
  }

  .tks-burger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .tks-backdrop.open {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 30;
    animation: tks-fade 180ms linear both;
  }

  .tks-scroll {
    padding: 6px 12px 0;
  }

  .tks-composer {
    padding: 6px 12px 10px;
  }

  .tks-msg.user .tks-bubble {
    max-width: 88%;
  }

  .tks-meters {
    order: 3;
  }

  .tks-picker-trigger {
    max-width: 170px;
  }

}

@media (max-width: 700px) {
  .tks-top {
    flex-wrap: nowrap;
    gap: 6px;
    padding: 8px 10px;
  }

  .tks-top-title {
    display: none;
  }

  .tks-picker {
    flex: 1;
    min-width: 0;
  }

  .tks-picker-trigger {
    max-width: 100%;
    padding: 0 8px;
    font-size: 14px;
  }

  .tks-lang-trigger {
    padding: 0 8px;
  }

  .tks-empty h1 {
    font-size: 25px;
  }

  .tks-box {
    padding: 10px 10px 8px 14px;
  }

  .tks-controls {
    flex-wrap: nowrap;
    gap: 5px;
  }

  .tks-toggle {
    padding: 0 9px;
  }

  .tks-toggle-text,
  .tks-select-prefix {
    display: none;
  }

  .tks-select-trigger {
    padding: 0 9px 0 10px;
  }
}

@media (max-height: 600px) {
  .tks-empty-mark {
    display: none;
  }

  .tks-empty {
    margin-bottom: 12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .s-studio-page * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

.tks-acts.user {
  justify-content: flex-end;
  opacity: 0;
  transition: opacity var(--tr);
}

.tks-msg.user:hover .tks-acts.user,
.tks-msg.user:focus-within .tks-acts.user {
  opacity: 1;
}

.tks-acts.user .tks-when {
  margin: 0 0 0 6px;
}

.tks-act.danger:hover {
  color: var(--err);
  background: rgba(248, 113, 113, 0.1);
}

.tks-edit {
  width: min(100%, 640px);
  border: 1px solid rgba(59, 130, 246, 0.4);
  border-radius: 20px;
  background: var(--surface-hi);
  padding: 12px 14px 10px;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
}

.tks-edit textarea {
  width: 100%;
  min-height: 28px;
  max-height: 320px;
  resize: none;
  border: 0;
  outline: none;
  background: transparent;
  color: var(--text);
  font-size: 15px;
  line-height: 1.6;
  padding: 0;
  box-shadow: none;
}

.tks-edit textarea:focus,
.tks-edit textarea:focus-visible {
  outline: none;
  box-shadow: none;
}

.tks-edit-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 8px;
}

.tks-edit-actions .tks-dialog-btn {
  flex: 0 0 auto;
  height: 34px;
  padding: 0 14px;
}

.tks-toggle.tks-static {
  cursor: default;
}

.tks-clip {
  height: auto;
  min-height: 44px;
  padding: 7px 6px 7px 10px;
  align-items: center;
}

.tks-clip-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.tks-clip-body .tks-chat-title {
  font-size: 13px;
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tks-clip-when {
  font-size: 11px;
  color: var(--text-mut);
  font-variant-numeric: tabular-nums;
}

.tks-clip.failed .tks-chat-title {
  color: var(--text-mut);
  text-decoration: line-through;
  text-decoration-color: rgba(248, 113, 113, 0.5);
}

.tks-video {
  display: flex;
  flex-direction: column;
  gap: 14px;
  animation: tks-fade 220ms cubic-bezier(0.4, 0, 0.2, 1) both;
}

.tks-video-frame {
  border-radius: 18px;
  overflow: hidden;
  background: var(--bg-1);
  border: 1px solid var(--border);
  aspect-ratio: 16 / 9;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tks-vp {
  position: relative;
  width: 100%;
  height: 100%;
  background: #000;
  line-height: 0;
  outline: none;
}

.tks-vp:focus-visible {
  box-shadow: inset 0 0 0 2px rgba(59, 130, 246, 0.55);
}

.tks-vp.full {
  display: flex;
  align-items: center;
  justify-content: center;
}

.tks-vp-media {
  display: block;
  width: 100%;
  height: 100%;
  background: #000;
  cursor: pointer;
}

.tks-vp.full .tks-vp-media {
  max-width: 100vw;
  max-height: 100vh;
}

.tks-vp-big {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 68px;
  height: 68px;
  margin: -34px 0 0 -34px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(10, 10, 12, 0.6);
  color: #fff;
  cursor: pointer;
  transition: background var(--tr), transform var(--tr);
}

.tks-vp-big svg {
  width: 28px;
  height: 28px;
  margin-left: 3px;
}

.tks-vp-big:hover {
  background: rgba(10, 10, 12, 0.78);
  transform: scale(1.05);
}

.tks-vp-bar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 26px 14px 11px;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.88), rgba(0, 0, 0, 0.5) 55%, rgba(0, 0, 0, 0));
  line-height: 1;
  transition: opacity 220ms ease;
}

.tks-vp.playing:not(:hover):not(:focus-within) .tks-vp-bar {
  opacity: 0;
}

.tks-vp-btn {
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: #e8e8ee;
  cursor: pointer;
  transition: background var(--tr), color var(--tr);
}

.tks-vp-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.tks-vp-btn svg {
  width: 17px;
  height: 17px;
}

.tks-vp-time {
  flex-shrink: 0;
  font-size: 12px;
  color: #d4dae4;
  font-variant-numeric: tabular-nums;
}

.tks-vp-track {
  position: relative;
  flex: 1 1 0;
  min-width: 40px;
  height: 16px;
  display: flex;
  align-items: center;
  cursor: pointer;
  touch-action: none;
}

.tks-vp-track::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  height: 4px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.22);
}

.tks-vp-buf {
  position: absolute;
  left: 0;
  height: 4px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.32);
}

.tks-vp-fill {
  position: absolute;
  left: 0;
  height: 4px;
  border-radius: 3px;
  background: var(--accent);
}

.tks-vp-knob {
  position: absolute;
  width: 11px;
  height: 11px;
  margin-left: -5.5px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
}

.tks-vp-sound {
  flex: 0 1 auto;
  min-width: 0;
  display: flex;
  align-items: center;
}

.tks-vp-volwrap {
  display: flex;
  align-items: center;
  flex: 0 1 auto;
  width: 0;
  min-width: 0;
  overflow: hidden;
  transition: width var(--tr), margin-left var(--tr);
}

.tks-vp-vol {
  -webkit-appearance: none;
  appearance: none;
  flex: 0 0 68px;
  width: 68px;
  height: 11px;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  opacity: 0;
  pointer-events: none;
  cursor: pointer;
  transition: opacity var(--tr);
}

.tks-vp-vol::-webkit-slider-runnable-track {
  height: 4px;
  border-radius: 3px;
  background: linear-gradient(to right, var(--accent) 0%, var(--accent) calc(var(--vol, 1) * 100%), rgba(255, 255, 255, 0.22) calc(var(--vol, 1) * 100%), rgba(255, 255, 255, 0.22) 100%);
}

.tks-vp-vol::-moz-range-track {
  height: 4px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.22);
}

.tks-vp-vol::-moz-range-progress {
  height: 4px;
  border-radius: 3px;
  background: var(--accent);
}

.tks-vp-vol::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 11px;
  height: 11px;
  margin-top: -3.5px;
  border: 0;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
}

.tks-vp-vol::-moz-range-thumb {
  width: 11px;
  height: 11px;
  border: 0;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
}

.tks-vp-vol:focus-visible::-webkit-slider-thumb {
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.5), 0 0 0 3px rgba(59, 130, 246, 0.4);
}

.tks-vp-sound:hover .tks-vp-volwrap,
.tks-vp-sound:focus-within .tks-vp-volwrap {
  width: 68px;
  max-width: 100%;
  margin-left: 6px;
}

.tks-vp-sound:hover .tks-vp-vol,
.tks-vp-sound:focus-within .tks-vp-vol {
  opacity: 1;
  pointer-events: auto;
}

@media (max-width: 560px) {
  .tks-vp-volwrap {
    display: none;
  }

  .tks-vp-bar {
    gap: 6px;
    padding: 22px 8px 8px;
  }
}

.tks-video-meta {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.tks-video-meta .tks-when {
  margin-left: 2px;
}

.tks-video-prompt {
  margin: 0;
  font-size: 15px;
  line-height: 1.6;
  color: #ececf1;
}

.tks-video-hint {
  margin: 0;
  font-size: 13px;
  color: var(--text-mut);
}

.tks-share-dialog {
  max-width: 560px;
  padding: 16px 18px 18px;
}

.tks-share-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.tks-share-head h2 {
  margin: 0;
}

.tks-share-canvas {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.tks-share-preview {
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--bg-1);
  max-height: 60vh;
  overflow-y: auto;
  margin-bottom: 14px;
}

.tks-share-preview img {
  display: block;
  width: 100%;
  height: auto;
}

@media (max-width: 700px) {
  .tks-acts.user {
    opacity: 1;
  }

  .tks-share-dialog {
    max-width: 100%;
  }
}

.tks-limits-btn {
  display: none;
  width: 36px;
  height: 36px;
  padding: 2px;
  border: 0;
  border-radius: 10px;
  background: conic-gradient(var(--ring-tone, #3b82f6) calc(var(--ring, 0) * 1%), rgba(255, 255, 255, 0.12) 0);
  color: var(--text-dim);
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex: none;
}

.tks-limits-inner {
  width: 100%;
  height: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: var(--bg);
  color: var(--ring-tone, var(--text-dim));
}

.tks-limits-btn svg {
  width: 16px;
  height: 16px;
}

.tks-limits-pop {
  position: absolute;
  top: calc(100% - 2px);
  right: 12px;
  width: min(300px, calc(100vw - 24px));
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--border-hi);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: 0 20px 48px -18px rgba(0, 0, 0, 0.85);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: opacity 150ms ease, transform 150ms ease, visibility 0s linear 150ms;
  z-index: 30;
}

.tks-limits-pop.open {
  opacity: 1;
  visibility: visible;
  transform: none;
  transition: opacity 150ms ease, transform 150ms ease, visibility 0s;
}

.tks-limits-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 9px 11px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.02);
  height: auto;
  min-width: 0;
  cursor: default;
}

.tks-limits-row .tks-meter-row {
  font-size: 12px;
  color: var(--text-mut);
}

.tks-limits-row .tks-meter-card-head {
  font-size: 12.5px;
}

.tks-limits-key {
  font-size: 11.5px;
  color: var(--text-mut);
  text-align: center;
}

.tks-limits-btn.on .tks-limits-inner {
  background: var(--surface-hi);
}

.tks-card-lang {
  margin-left: auto;
  margin-right: 6px;
  padding: 2px;
}

.tks-card-lang button {
  height: 26px;
  padding: 0 10px;
  font-size: 12px;
}

.tks-toasts {
  position: fixed;
  left: 50%;
  bottom: 30px;
  transform: translateX(-50%);
  z-index: 9999;
  display: flex;
  flex-direction: column-reverse;
  gap: 8px;
  align-items: center;
  pointer-events: none;
}

.tks-toast {
  pointer-events: auto;
  background: var(--accent);
  color: #fff;
  padding: 10px 18px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 500;
  box-shadow: 0 8px 28px rgba(0, 119, 255, 0.35);
  cursor: pointer;
  user-select: none;
  transform: translateY(40px);
  opacity: 0;
  transition: transform 0.32s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.25s ease-out;
  will-change: transform, opacity;
  line-height: 1.45;
  max-width: min(90vw, 420px);
  text-align: center;
  overflow-wrap: anywhere;
}

.tks-toast.shown {
  transform: none;
  opacity: 1;
}

.tks-toast.error {
  background: #e5484d;
  box-shadow: 0 8px 28px rgba(229, 72, 77, 0.38);
}

@media (max-width: 700px) {
  .tks-meters,
  .tks-topup-head {
    display: none;
  }

  .tks-limits-btn {
    display: inline-flex;
  }

  .tks-picker {
    flex: 1 1 auto;
    min-width: 120px;
  }

  .tks-picker-menu {
    min-width: 0;
    width: min(300px, calc(100vw - 24px));
    max-height: min(360px, 60vh);
    padding: 5px;
  }

  .tks-picker-list button {
    gap: 8px;
    padding: 6px 8px;
  }

  .tks-picker-name {
    font-size: 12.5px;
  }

  .tks-picker-owner {
    font-size: 11px;
  }

  .tks-picker-logo,
  .tks-picker-logo svg {
    width: 18px;
    height: 18px;
  }

  .tks-picker-tools {
    padding: 4px 4px 6px;
  }

  .tks-picker-sort button {
    font-size: 11.5px;
  }

  .tks-toasts {
    bottom: 96px;
  }
}

.tks-err-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.tks-retry {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  padding: 0 11px;
  border-radius: 20px;
  border: 1px solid rgba(248, 113, 113, 0.35);
  background: rgba(248, 113, 113, 0.1);
  color: #fca5a5;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--tr), border-color var(--tr), color var(--tr);
}

.tks-retry svg {
  width: 13px;
  height: 13px;
}

.tks-retry:hover {
  background: rgba(248, 113, 113, 0.2);
  border-color: rgba(248, 113, 113, 0.5);
  color: #fff;
}

.tks-picker-note {
  border: 1px solid var(--border-hi);
  color: var(--text-mut);
  border-radius: 20px;
  padding: 1px 7px;
  font-size: 10.5px;
  font-weight: 500;
  margin-left: 6px;
}

.tks-attach.image.tks-frame {
  width: 108px;
}

.tks-frame .tks-frame-tag,
.tks-slot .tks-frame-tag {
  position: absolute;
  left: 4px;
  bottom: 4px;
  right: 4px;
  padding: 2px 5px;
  border-radius: 6px;
  background: rgba(5, 5, 7, 0.72);
  color: var(--text);
  font-size: 10px;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  pointer-events: none;
}

.tks-toggle.need {
  border-color: rgba(250, 204, 21, 0.45);
  color: var(--warn);
}

.tks-req {
  color: var(--warn);
  margin-left: 2px;
}

a.tks-attach {
  text-decoration: none;
}

.tks-video.pending .tks-video-frame {
  border-style: dashed;
}

.tks-video.pending .tks-video-frame .tks-wait {
  justify-content: center;
  padding: 24px;
}

.tks-meter.free:not(.warn):not(.bad) .tks-meter-fill,
.tks-meter-card.free:not(.warn):not(.bad) .tks-meter-fill {
  background: var(--ok);
}

.tks-meter.free:not(.warn):not(.bad) .tks-meter-head strong,
.tks-meter-card.free:not(.warn):not(.bad) .tks-meter-card-head strong {
  color: var(--ok);
}

.tks-meter-note {
  display: block;
  margin-top: 6px;
  font-size: 11.5px;
  color: var(--text-mut);
}

.tks-frames {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 2px 2px 10px;
}

.tks-slot {
  position: relative;
  width: 112px;
  height: 70px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 0 6px;
  border: 1px dashed var(--border-hi);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.02);
  color: var(--text-mut);
  font-size: 11px;
  font-weight: 500;
  line-height: 1.2;
  text-align: center;
  cursor: pointer;
  transition: border-color var(--tr), color var(--tr), background var(--tr);
}

.tks-slot svg {
  width: 19px;
  height: 19px;
}

.tks-slot:hover {
  border-color: rgba(255, 255, 255, 0.28);
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
}

.tks-slot.need {
  border-color: rgba(250, 204, 21, 0.5);
  color: var(--warn);
}

.tks-slot.filled {
  padding: 0;
  border-style: solid;
  overflow: hidden;
  cursor: default;
}

.tks-slot.filled img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.tks-slot.filled .tks-frame-tag {
  z-index: 1;
}

.tks-slot.filled .tks-attach-x {
  position: absolute;
  top: 4px;
  right: 4px;
}

@media (max-width: 560px) {
  .tks-slot {
    width: 88px;
    height: 62px;
  }
}

.tk-btn-spin {
  display: inline-block;
  width: 13px;
  height: 13px;
  margin-left: 8px;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  animation: tks-btn-spin 0.7s linear infinite;
  vertical-align: -2px;
  opacity: 0.85;
  flex-shrink: 0;
}

@keyframes tks-btn-spin {
  to {
    transform: rotate(360deg);
  }
}

[data-tk-busy] {
  cursor: progress;
}

.tks-act[data-tk-busy] .tk-btn-spin,
.tks-side-btn[data-tk-busy] .tk-btn-spin,
.tks-chat-x[data-tk-busy] .tk-btn-spin,
.tks-icon-btn[data-tk-busy] .tk-btn-spin,
.tks-send[data-tk-busy] .tk-btn-spin {
  display: none;
}

.tks-act[data-tk-busy],
.tks-side-btn[data-tk-busy],
.tks-chat-x[data-tk-busy],
.tks-icon-btn[data-tk-busy] {
  opacity: 0.55;
}

.tks-picker-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.tks-picker-logo {
  width: 22px;
  height: 22px;
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
}

.tks-picker-logo svg {
  width: 18px;
  height: 18px;
  border-radius: 4px;
}

.tks-picker-logo.plain {
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.07);
  font-size: 11px;
  font-weight: 700;
  color: var(--text-dim);
}

.tks-picker-logo.trigger {
  width: 18px;
  height: 18px;
}

.tks-picker-logo.trigger svg {
  width: 16px;
  height: 16px;
}

.tks-who-logo {
  width: 22px;
  height: 22px;
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
}

.tks-who-logo svg {
  width: 20px;
  height: 20px;
  border-radius: 4px;
}

.tks-skel {
  display: flex;
  flex-direction: column;
  gap: 26px;
  padding: 6px 0 12px;
}

.tks-skel span {
  display: block;
  height: 14px;
  border-radius: 7px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0.11) 50%, rgba(255, 255, 255, 0.05) 100%);
  background-size: 200% 100%;
  animation: tks-shimmer 1.4s ease-in-out infinite;
}

.tks-skel-user {
  display: flex;
  justify-content: flex-end;
}

.tks-skel-user span {
  height: 42px;
  border-radius: 22px;
}

.tks-skel-bot {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.tks-skel-bot .tks-skel-mark {
  width: 22px;
  height: 22px;
  border-radius: 7px;
  margin-bottom: 2px;
}

@keyframes tks-shimmer {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

.tks-img-wrap {
  display: inline-block;
  width: fit-content;
  max-width: min(100%, 420px);
  border-radius: 14px;
  overflow: hidden;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0.11) 50%, rgba(255, 255, 255, 0.05) 100%);
  background-size: 200% 100%;
  animation: tks-shimmer 1.4s ease-in-out infinite;
  min-width: 120px;
  min-height: 90px;
}

.tks-img-wrap.loaded {
  animation: none;
  background: transparent;
  min-width: 0;
  min-height: 0;
}

.tks-img-wrap img {
  display: block;
  opacity: 0;
  transition: opacity 260ms ease;
}

.tks-img-wrap.loaded img {
  opacity: 1;
}

@media (prefers-reduced-motion: reduce) {
  .tks-skel span,
  .tks-img-wrap {
    animation: none;
  }
}

.tks-wait-video {
  flex-direction: column;
  align-items: stretch;
  gap: 12px;
  width: min(520px, 86%);
}

.tks-wait-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.tks-wait-row .tks-wait-label {
  white-space: normal;
  text-align: left;
  min-width: 0;
}

.tks-wait-pct {
  margin-left: auto;
  color: var(--text);
  font-size: 13.5px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

@media (max-width: 560px) {
  .tks-wait-row .tks-wait-label {
    white-space: normal;
  }
}

.tks-wait-track {
  height: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.tks-wait-fill {
  height: 100%;
  border-radius: 999px;
  background: var(--accent);
  transition: width 600ms cubic-bezier(0.4, 0, 0.2, 1);
}

button.tks-img-wrap,
button.tks-frame {
  padding: 0;
  border: 0;
  color: inherit;
  font: inherit;
  cursor: zoom-in;
}

button.tks-frame {
  border: 1px solid var(--border-hi);
}

.tks-lb {
  position: fixed;
  inset: 0;
  z-index: 260;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  animation: tks-fade 160ms cubic-bezier(0.4, 0, 0.2, 1) both;
}

.tks-lb-back {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.66);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.tks-lb-frame {
  position: relative;
  max-width: min(94vw, 1400px);
  max-height: 90vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tks-lb-frame img {
  display: block;
  max-width: min(94vw, 1400px);
  max-height: 90vh;
  border-radius: 14px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.65);
  cursor: zoom-out;
}


.tks-picker-unstable {
  display: inline-flex;
  align-items: center;
  height: 18px;
  margin-left: 7px;
  padding: 0 7px;
  border-radius: 6px;
  border: 1px solid rgba(250, 204, 21, 0.3);
  background: rgba(250, 204, 21, 0.1);
  color: #facc15;
  font-size: 10.5px;
  font-weight: 600;
  line-height: 1;
  vertical-align: middle;
  white-space: nowrap;
}

.tks-picker-badge {
  display: inline-flex;
  align-items: center;
  height: 18px;
  margin-left: 7px;
  padding: 0 7px;
  border-radius: 6px;
  color: #fff;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: normal;
  text-transform: none;
  line-height: 1;
  vertical-align: middle;
  white-space: nowrap;
}

.tks-picker-badge-new {
  background: linear-gradient(135deg, #06b6d4 0%, #3b82f6 100%);
}

.tks-picker-badge-best {
  background: linear-gradient(135deg, #8b5cf6 0%, #ec4899 100%);
}

@supports (text-box: trim-both cap alphabetic) {
  .tks-picker-badge {
    display: inline-block;
    box-sizing: border-box;
    padding-block: calc((18px - 1cap) / 2);
    text-box: trim-both cap alphabetic;
  }

  .tks-picker-unstable {
    display: inline-block;
    box-sizing: border-box;
    padding-block: calc((16px - 1cap) / 2);
    text-box: trim-both cap alphabetic;
  }

  .tks-picker-trigger > span:not([class]) {
    padding-block: calc((1lh - 1cap) / 2);
    text-box: trim-both cap alphabetic;
  }
}

.tks-picker-unstable-dot {
  flex: none;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #facc15;
  box-shadow: 0 0 0 3px rgba(250, 204, 21, 0.18);
}

.tks-picker-reason {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 4px 8px 8px;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(250, 204, 21, 0.07);
  border: 1px solid rgba(250, 204, 21, 0.16);
  color: var(--text-dim);
  font-size: 12.5px;
  line-height: 1.5;
}

.tks-picker-reason svg {
  flex: none;
  width: 16px;
  height: 16px;
  margin-top: 1px;
  color: #facc15;
}

.tks-charged {
  color: var(--text-dim);
}

.tks-video-missing {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  max-width: 420px;
  padding: 0 20px;
  text-align: center;
  color: var(--text-mut);
  font-size: 13.5px;
  line-height: 1.5;
}

.tks-video-missing svg {
  width: 26px;
  height: 26px;
  color: var(--text-mut);
  opacity: 0.7;
}

.tks-video-missing-acts {
  display: flex;
  gap: 8px;
  margin-top: 6px;
}

.tks-video-missing-acts .tks-dialog-btn {
  padding: 8px 14px;
}

.tks-video-acts {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  margin-left: auto;
}

.tks-who .tks-video-acts .tks-act {
  width: 28px;
  height: 28px;
}

.tks-bubble ul ul,
.tks-bubble ol ol,
.tks-bubble ul ol,
.tks-bubble ol ul {
  margin: 4px 0 2px;
}

.tks-bubble li.tks-task {
  list-style: none;
  margin-left: -18px;
}

.tks-bubble li.tks-task input {
  width: 14px;
  height: 14px;
  margin: 0 6px 0 0;
  vertical-align: -2px;
  accent-color: var(--accent);
}

.tks-bubble u {
  text-decoration: underline;
  text-underline-offset: 2px;
}

.tks-bubble s {
  color: var(--text-mut);
}

.tks-spoiler {
  display: inline;
  padding: 0 3px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.14);
  color: transparent;
  text-shadow: 0 0 9px rgba(255, 255, 255, 0.9);
  cursor: pointer;
  transition: color var(--tr), background var(--tr), text-shadow var(--tr);
  user-select: none;
}

.tks-spoiler.shown {
  background: rgba(255, 255, 255, 0.06);
  color: inherit;
  text-shadow: none;
  user-select: text;
}

.tks-table {
  max-width: 100%;
  margin: 8px 0 12px;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 10px;
}

.tks-table table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.tks-table th,
.tks-table td {
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}

.tks-table th {
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  font-weight: 600;
  white-space: nowrap;
}

.tks-table tr:last-child td {
  border-bottom: 0;
}

.tks-table tbody tr:nth-child(even) td {
  background: rgba(255, 255, 255, 0.015);
}

.tks-md-img {
  display: block;
  max-width: min(100%, 520px);
  max-height: 420px;
  margin: 8px 0;
  border-radius: 12px;
  border: 1px solid var(--border);
}

.tks-jump {
  position: absolute;
  left: 50%;
  bottom: calc(var(--composer-h, 132px) + 14px);
  transform: translateX(-50%);
  z-index: 6;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 34px;
  padding: 0;
  width: 34px;
  justify-content: center;
  border-radius: 999px;
  border: 1px solid var(--border-hi);
  background: var(--surface-hi);
  color: var(--text);
  font-size: 12.5px;
  font-weight: 500;
  box-shadow: 0 10px 30px -12px rgba(0, 0, 0, 0.9);
  cursor: pointer;
  animation: tks-jump-in 160ms cubic-bezier(0.4, 0, 0.2, 1) both;
  transition: border-color var(--tr), box-shadow var(--tr);
}

@keyframes tks-jump-in {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateX(-50%);
  }
}

.tks-jump.labeled {
  width: auto;
  padding: 0 12px 0 12px;
}

.tks-jump svg {
  width: 15px;
  height: 15px;
}

.tks-jump:hover {
  border-color: rgba(255, 255, 255, 0.22);
  box-shadow: 0 10px 30px -12px rgba(0, 0, 0, 0.9), inset 0 0 0 99px rgba(255, 255, 255, 0.06);
}

.tks-jump-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  animation: tks-pulse 1.1s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

.tks-math-block {
  margin: 8px 0 12px;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 4px 2px;
}

.tks-math-block .tks-math {
  display: block;
  text-align: center;
}

.tks-math:not([data-rendered]) {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.92em;
  color: var(--text-dim);
}

.tks-bubble .katex {
  font-size: 1.08em;
}

.tks-bubble .katex-display {
  margin: 6px 0;
}

.tks-chatcfg svg {
  width: 17px;
  height: 17px;
}

.tks-chatcfg.on {
  color: var(--accent);
  border-color: rgba(59, 130, 246, 0.45);
  background: rgba(59, 130, 246, 0.12);
}

.tks-dialog-btn.wipe {
  margin-right: auto;
  color: #f87171;
  border-color: rgba(248, 113, 113, 0.28);
}

.tks-dialog-btn.wipe:hover {
  background: rgba(248, 113, 113, 0.12);
  border-color: rgba(248, 113, 113, 0.45);
}
body[class] textarea{resize:none!important}
.tk-gly,
body[class] .tk-gly {
  display: inline-block;
  width: 1em;
  height: 1em;
  vertical-align: -0.14em;
  flex-shrink: 0;
}

.tk-gly-arrow-right,
.tk-gly-arrow-left,
body[class] .tk-gly-arrow-right,
body[class] .tk-gly-arrow-left {
  width: 1.05em;
}
@font-face {
  font-family: 'Tokenator Segoe';
  src: local('Segoe UI');
  font-weight: 100 500;
  ascent-override: 95%;
  descent-override: 25%;
  line-gap-override: 0%;
}

@font-face {
  font-family: 'Tokenator Segoe';
  src: local('Segoe UI Semibold'), local('SegoeUI-Semibold');
  font-weight: 600;
  ascent-override: 95%;
  descent-override: 25%;
  line-gap-override: 0%;
}

@font-face {
  font-family: 'Tokenator Segoe';
  src: local('Segoe UI Bold'), local('SegoeUI-Bold');
  font-weight: 700 900;
  ascent-override: 95%;
  descent-override: 25%;
  line-gap-override: 0%;
}

html,
body,
:root body[class] {
  font-family: -apple-system, BlinkMacSystemFont, 'Inter', 'SF Pro Display', 'Tokenator Segoe', 'Segoe UI', Roboto, sans-serif;
}

button,
input,
select,
textarea {
  font-family: inherit;
}
body[class][class] #userChipBox:empty,
body[class][class] .nav-wrap > #userChipBox:empty,
body[class][class] header #userChipBox:empty{display:none}
@media(min-width:721px){
body[class] .cta-account.tk-signin{width:auto;padding:0 16px;gap:7px}
body[class] .cta-account.tk-signin .cta-account-label{display:inline}
}
