/* toomotions AI assistant - full-screen glass interface */
.tmai-root {
  --tm-brand: #04abf2;
  --tm-brand-dark: #0390cc;
  --tm-accent: #d97757;              /* warm mark colour, like the AI "spark" */
  --tm-glass: rgba(250, 250, 252, .62);
  --tm-glass-side: rgba(255, 255, 255, .55);
  --tm-surface: rgba(255, 255, 255, .78);
  --tm-surface-2: rgba(0, 0, 0, .045);
  --tm-line: rgba(20, 24, 33, .10);
  --tm-line-strong: rgba(20, 24, 33, .18);
  --tm-text: #1b1d22;
  --tm-muted: #6b6f78;
  --tm-user-bg: rgba(20, 24, 33, .07);
  --tm-red: #d64545;
  --tm-green: #22955a;
  --tm-shadow: 0 18px 50px rgba(16, 24, 40, .18);
  font-family: "Söhne", "Inter", Lato, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Noto Sans Devanagari", sans-serif;
  font-size: 15px;
  line-height: 1.6;
  color: var(--tm-text);
}
.tmai-root.tmai-dark {
  --tm-glass: rgba(18, 19, 23, .62);
  --tm-glass-side: rgba(30, 31, 37, .55);
  --tm-surface: rgba(40, 42, 50, .72);
  --tm-surface-2: rgba(255, 255, 255, .06);
  --tm-line: rgba(255, 255, 255, .09);
  --tm-line-strong: rgba(255, 255, 255, .18);
  --tm-text: #ececf0;
  --tm-muted: #a1a3ad;
  --tm-user-bg: rgba(255, 255, 255, .09);
  --tm-shadow: 0 18px 50px rgba(0, 0, 0, .55);
}
.tmai-root *, .tmai-root *::before, .tmai-root *::after { box-sizing: border-box; }
.tmai-hidden { display: none !important; }
html.tmai-lock, html.tmai-lock body { overflow: hidden !important; }
.tmai-i { display: inline-flex; width: 20px; height: 20px; flex: none; }
.tmai-i svg { width: 100%; height: 100%; display: block; }

/* the site's own styles for header, textarea, span and svg must not leak in */
.tmai-root .tmai-top { background: transparent !important; border: 0 !important; box-shadow: none !important; position: relative; height: auto; }
.tmai-root textarea.tmai-input { background: transparent !important; border: 0 !important; box-shadow: none !important; margin: 0; padding: 4px 0 !important; border-radius: 0; color: var(--tm-text) !important; }
.tmai-root .tmai-a-mark, .tmai-root .tmai-hero-mark, .tmai-root .tmai-brand-mark { color: var(--tm-accent) !important; }
.tmai-root .tmai-i svg [fill="currentColor"] { fill: currentColor !important; }
.tmai-root .tmai-i svg [stroke="currentColor"] { stroke: currentColor !important; }
.tmai-root .tmai-i svg [fill="none"] { fill: none !important; }

/* ------------------------------------------------------------ launcher */
.tmai-launcher {
  position: fixed; right: 22px; bottom: 22px; z-index: 99998;
  display: flex; align-items: center; gap: 8px; height: 50px; padding: 0 20px 0 16px;
  border: 1px solid rgba(255, 255, 255, .25); border-radius: 25px; cursor: pointer;
  color: #fff; font: inherit; font-weight: 600; font-size: 15px;
  background: linear-gradient(135deg, #0aa8ee, #6a5cff);
  box-shadow: 0 8px 26px rgba(70, 90, 255, .4);
  transition: transform .18s ease, box-shadow .18s ease;
}
.tmai-launcher:hover { transform: translateY(-2px); box-shadow: 0 12px 32px rgba(70, 90, 255, .5); }
.tmai-launcher:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }
.tmai-launcher-icon { width: 22px; height: 22px; animation: tmai-twinkle 3.2s ease-in-out infinite; }
@keyframes tmai-twinkle { 0%, 100% { transform: rotate(0) scale(1); } 50% { transform: rotate(45deg) scale(.88); } }
.tmai-open .tmai-launcher { display: none; }

/* ------------------------------------------------------- glass overlay */
.tmai-overlay {
  position: fixed; inset: 0; z-index: 99999; display: none;
  background: var(--tm-glass);
  -webkit-backdrop-filter: blur(26px) saturate(160%);
  backdrop-filter: blur(26px) saturate(160%);
}
.tmai-open .tmai-overlay { display: block; animation: tmai-fade .22s ease-out; }
@keyframes tmai-fade { from { opacity: 0; } to { opacity: 1; } }
.tmai-open .tmai-shell { animation: tmai-zoom .28s cubic-bezier(.2, .8, .2, 1); }
@keyframes tmai-zoom { from { opacity: 0; transform: scale(.985) translateY(8px); } to { opacity: 1; transform: none; } }
.tmai-overlay.tmai-dropping::after {
  content: 'Drop the video to upload it'; position: absolute; inset: 16px; z-index: 5; display: flex; align-items: center; justify-content: center;
  border: 2px dashed var(--tm-brand); border-radius: 20px; background: rgba(4, 171, 242, .08); color: var(--tm-text); font-size: 18px; font-weight: 600;
}
.tmai-shell { position: absolute; inset: 0; display: flex; }

/* ------------------------------------------------------------- sidebar */
.tmai-side {
  width: 272px; flex: none; display: flex; flex-direction: column; gap: 4px; padding: 14px 10px;
  background: var(--tm-glass-side); border-right: 1px solid var(--tm-line);
  transition: margin-left .25s ease, opacity .2s ease;
}
.tmai-side-closed .tmai-side { margin-left: -272px; opacity: 0; pointer-events: none; }
.tmai-brand { display: flex; align-items: center; gap: 9px; padding: 4px 8px 12px; font-weight: 600; font-size: 16px; }
.tmai-brand-mark { width: 22px; height: 22px; color: var(--tm-accent); }
.tmai-newchat {
  display: flex; align-items: center; gap: 8px; width: 100%; padding: 9px 10px; border: 0; border-radius: 10px;
  background: transparent; color: var(--tm-text); font: inherit; font-weight: 500; cursor: pointer; text-align: left;
}
.tmai-newchat .tmai-i { width: 22px; height: 22px; padding: 3px; border-radius: 50%; background: var(--tm-accent); color: #fff; }
.tmai-newchat:hover { background: var(--tm-surface-2); }
.tmai-side-label { padding: 14px 10px 6px; font-size: 12px; color: var(--tm-muted); font-weight: 500; }
.tmai-convs { flex: 1; overflow-y: auto; min-height: 0; scrollbar-width: thin; }
.tmai-side-empty { padding: 6px 10px; font-size: 13px; color: var(--tm-muted); }
.tmai-conv { display: flex; align-items: center; border-radius: 9px; }
.tmai-conv:hover, .tmai-conv.active { background: var(--tm-surface-2); }
.tmai-conv.active .tmai-conv-open { font-weight: 500; }
.tmai-conv-open {
  flex: 1; min-width: 0; padding: 8px 10px; border: 0; background: none; color: var(--tm-text); font: inherit; font-size: 14px;
  text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer;
}
.tmai-conv-del { width: 30px; height: 30px; border: 0; background: none; color: var(--tm-muted); cursor: pointer; opacity: 0; border-radius: 8px; padding: 6px; }
.tmai-conv:hover .tmai-conv-del, .tmai-conv-del:focus { opacity: 1; }
.tmai-conv-del:hover { color: var(--tm-red); }
.tmai-conv-del .tmai-i { width: 18px; height: 18px; }
.tmai-side-foot { padding-top: 8px; border-top: 1px solid var(--tm-line); }
.tmai-me { display: flex; align-items: center; gap: 10px; padding: 8px 6px; font-size: 14px; font-weight: 500; }
.tmai-me img { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; }
.tmai-me span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tmai-scrim { display: none; }

/* ---------------------------------------------------------------- main */
.tmai-main { flex: 1; min-width: 0; display: flex; flex-direction: column; position: relative; }
.tmai-top { display: flex; align-items: center; gap: 6px; padding: 10px 12px; min-height: 56px; }
.tmai-top-title { flex: 1; min-width: 0; text-align: center; font-weight: 500; font-size: 14px; color: var(--tm-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 0 8px; }
.tmai-ibtn {
  width: 38px; height: 38px; flex: none; display: inline-flex; align-items: center; justify-content: center;
  border: 0; border-radius: 10px; background: transparent; color: var(--tm-muted); cursor: pointer;
}
.tmai-ibtn:hover { background: var(--tm-surface-2); color: var(--tm-text); }
.tmai-ibtn-new { display: none; }
.tmai-side-closed .tmai-ibtn-new { display: inline-flex; }

.tmai-scroll { flex: 1; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; }
.tmai-list { max-width: 780px; margin: 0 auto; padding: 8px 24px 28px; display: flex; flex-direction: column; gap: 22px; }

/* start screen: greeting and composer in the middle */
.tmai-is-empty .tmai-scroll { flex: 0 0 auto; overflow: visible; }
.tmai-is-empty { justify-content: center; }
.tmai-is-empty .tmai-top { position: absolute; top: 0; left: 0; right: 0; }
.tmai-is-empty .tmai-dock { padding-bottom: 12vh; }
.tmai-hero { text-align: center; padding: 0 0 6px; animation: tmai-rise .45s ease-out both; }
.tmai-hero h1 { margin: 10px 0 6px; font-size: clamp(26px, 3.4vw, 38px); font-weight: 400; letter-spacing: -.01em; color: var(--tm-text); font-family: Georgia, "Times New Roman", serif; }
.tmai-hero p { margin: 0; color: var(--tm-muted); font-size: 15px; }
.tmai-hero-mark { width: 38px; height: 38px; color: var(--tm-accent); animation: tmai-twinkle 4s ease-in-out infinite; }

/* ------------------------------------------------------------ messages */
.tmai-msg { animation: tmai-rise .3s ease-out both; }
@keyframes tmai-rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.tmai-rise { animation: tmai-rise .4s ease-out both; }
.tmai-user { display: flex; justify-content: flex-end; }
.tmai-user-bubble {
  max-width: 78%; padding: 10px 16px; border-radius: 18px; background: var(--tm-user-bg); color: var(--tm-text);
  word-wrap: break-word; overflow-wrap: anywhere;
}
.tmai-assistant { display: flex; gap: 14px; align-items: flex-start; }
.tmai-a-mark { width: 24px; height: 24px; margin-top: 2px; color: var(--tm-accent); }
.tmai-a-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.tmai-text { word-wrap: break-word; overflow-wrap: anywhere; }
.tmai-text:empty { display: none; }
.tmai-text a { color: var(--tm-brand); text-decoration: underline; text-underline-offset: 2px; }
.tmai-text code { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .9em; padding: 1px 5px; border-radius: 5px; background: var(--tm-surface-2); }
.tmai-h { display: block; font-weight: 600; font-size: 16px; margin: 6px 0 2px; }
.tmai-gap { display: block; height: 10px; }
.tmai-li { display: block; padding-left: 20px; position: relative; margin: 3px 0; }
.tmai-li::before { content: '•'; position: absolute; left: 6px; color: var(--tm-muted); }
.tmai-ol::before { content: attr(data-n); left: 0; font-variant-numeric: tabular-nums; }
.tmai-cursor { display: inline-block; width: 8px; height: 1.05em; margin-left: 2px; vertical-align: -2px; border-radius: 2px; background: var(--tm-text); animation: tmai-blink .9s steps(2) infinite; }
@keyframes tmai-blink { 50% { opacity: 0; } }
.tmai-cards { display: flex; flex-direction: column; gap: 12px; }
.tmai-cards:empty { display: none; }
.tmai-error-text { display: flex; gap: 8px; align-items: flex-start; color: var(--tm-red); }
.tmai-error-text .tmai-i { margin-top: 3px; }
.tmai-loading { display: flex; gap: 6px; justify-content: center; padding: 30px 0; }
.tmai-loading i { width: 7px; height: 7px; border-radius: 50%; background: var(--tm-muted); animation: tmai-dot 1s infinite ease-in-out; }
.tmai-loading i:nth-child(2) { animation-delay: .15s; } .tmai-loading i:nth-child(3) { animation-delay: .3s; }
@keyframes tmai-dot { 0%, 80%, 100% { opacity: .25; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }

/* actions under a reply */
.tmai-actions { display: flex; gap: 2px; margin-left: -6px; opacity: 0; transition: opacity .2s; }
.tmai-assistant:hover .tmai-actions, .tmai-assistant:last-child .tmai-actions, .tmai-actions:focus-within { opacity: 1; }
.tmai-act { width: 32px; height: 32px; display: inline-flex; align-items: center; justify-content: center; border: 0; border-radius: 8px; background: none; color: var(--tm-muted); cursor: pointer; padding: 7px; }
.tmai-act:hover { background: var(--tm-surface-2); color: var(--tm-text); }
.tmai-act .tmai-act-ok { display: none; color: var(--tm-green); }
.tmai-act.ok .tmai-i:first-child { display: none; }
.tmai-act.ok .tmai-act-ok { display: inline-flex; }

/* --------------------------------------------- live "working on it" box */
.tmai-think { align-self: flex-start; max-width: 100%; }
.tmai-think-head {
  display: inline-flex; align-items: center; gap: 10px; padding: 4px 8px 4px 2px; border: 0; border-radius: 9px;
  background: none; color: var(--tm-muted); font: inherit; font-size: 14px; cursor: pointer; text-align: left;
}
.tmai-think.is-done .tmai-think-head:hover { color: var(--tm-text); background: var(--tm-surface-2); }
.tmai-think.no-steps .tmai-think-head { cursor: default; }
.tmai-think.no-steps .tmai-think-chev { display: none; }
.tmai-think-time { font-variant-numeric: tabular-nums; opacity: .7; font-size: 13px; }
.tmai-think-time:empty { display: none; }
.tmai-think-chev { width: 15px; height: 15px; transition: transform .2s; }
.tmai-think.is-live .tmai-think-chev { display: none; }
.tmai-think.is-open .tmai-think-chev { transform: rotate(90deg); }
/* shimmering phase text while working */
.tmai-think.is-live .tmai-think-now {
  font-weight: 500; color: transparent;
  background: linear-gradient(90deg, var(--tm-muted) 0%, var(--tm-muted) 35%, var(--tm-text) 50%, var(--tm-muted) 65%, var(--tm-muted) 100%);
  background-size: 250% 100%; -webkit-background-clip: text; background-clip: text;
  animation: tmai-shimmer 1.8s linear infinite;
}
@keyframes tmai-shimmer { from { background-position: 100% 0; } to { background-position: -150% 0; } }
.tmai-swap { animation: tmai-swap .35s ease-out, tmai-shimmer 1.8s linear infinite !important; }
@keyframes tmai-swap { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: none; } }
/* animated orb: three dots orbiting while live, a calm mark when done */
.tmai-orb { position: relative; width: 20px; height: 20px; flex: none; }
.tmai-orb i { position: absolute; top: 50%; left: 50%; width: 6px; height: 6px; margin: -3px; border-radius: 50%; background: var(--tm-accent); }
.tmai-think.is-live .tmai-orb { animation: tmai-spin 1.4s linear infinite; }
.tmai-think.is-live .tmai-orb i:nth-child(1) { transform: translateY(-7px); }
.tmai-think.is-live .tmai-orb i:nth-child(2) { transform: rotate(120deg) translateY(-7px); opacity: .7; }
.tmai-think.is-live .tmai-orb i:nth-child(3) { transform: rotate(240deg) translateY(-7px); opacity: .4; }
@keyframes tmai-spin { to { transform: rotate(360deg); } }
.tmai-think.is-done .tmai-orb i { transition: transform .3s; }
.tmai-think.is-done .tmai-orb i:nth-child(1) { transform: translate(-4px, 0) scale(.8); }
.tmai-think.is-done .tmai-orb i:nth-child(2) { transform: translate(4px, 0) scale(.8); opacity: .6; }
.tmai-think.is-done .tmai-orb i:nth-child(3) { opacity: 0; }
.tmai-think-list { display: flex; flex-direction: column; gap: 6px; margin: 4px 0 2px 11px; padding-left: 19px; border-left: 1px solid var(--tm-line-strong); }
.tmai-think-list:empty { display: none; }
.tmai-think.is-done:not(.is-open) .tmai-think-list { display: none; }
.tmai-think-step { display: flex; gap: 8px; align-items: center; font-size: 13.5px; color: var(--tm-muted); animation: tmai-rise .3s ease-out both; }
.tmai-think-step .tmai-i { width: 15px; height: 15px; color: var(--tm-green); }
.tmai-think-step.is-bad .tmai-i { color: #d08a00; }

/* ---------------------------------------------------------------- dock */
.tmai-dock { width: 100%; max-width: 780px; margin: 0 auto; padding: 0 24px 10px; }
.tmai-composer {
  display: flex; flex-direction: column; gap: 4px; padding: 12px 12px 10px 16px;
  border: 1px solid var(--tm-line-strong); border-radius: 22px; background: var(--tm-surface);
  box-shadow: var(--tm-shadow); transition: border-color .2s, box-shadow .2s;
}
.tmai-composer:focus-within { border-color: rgba(4, 171, 242, .55); }
.tmai-input {
  width: 100%; min-height: 28px; max-height: 220px; resize: none; padding: 4px 0; border: 0; outline: none;
  background: transparent; color: var(--tm-text); font: inherit; font-size: 15.5px; line-height: 1.5;
}
.tmai-input::placeholder { color: var(--tm-muted); }
.tmai-composer-row { display: flex; align-items: center; gap: 6px; }
.tmai-spacer { flex: 1; }
.tmai-attach {
  width: 36px; height: 36px; display: inline-flex; align-items: center; justify-content: center; padding: 8px;
  border: 1px solid var(--tm-line); border-radius: 10px; background: transparent; color: var(--tm-muted); cursor: pointer;
}
.tmai-attach:hover { color: var(--tm-text); background: var(--tm-surface-2); }
.tmai-send {
  width: 36px; height: 36px; display: inline-flex; align-items: center; justify-content: center; padding: 8px;
  border: 0; border-radius: 10px; background: var(--tm-accent); color: #fff; cursor: pointer; transition: opacity .2s, transform .15s;
}
.tmai-send:hover:not(:disabled) { transform: translateY(-1px); }
.tmai-send:disabled { opacity: .35; cursor: default; }
.tmai-composer.is-busy .tmai-send { animation: tmai-pulse 1.2s ease-in-out infinite; }
@keyframes tmai-pulse { 50% { opacity: .55; } }
.tmai-disclaimer { padding: 8px 0 0; text-align: center; font-size: 12px; color: var(--tm-muted); }
.tmai-dock .tmai-chips { justify-content: center; margin-top: 14px; }
.tmai-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.tmai-chip {
  padding: 7px 14px; border: 1px solid var(--tm-line-strong); border-radius: 999px; background: var(--tm-surface);
  color: var(--tm-text); font: inherit; font-size: 13.5px; cursor: pointer; transition: background .15s, border-color .15s;
}
.tmai-chip:hover { background: var(--tm-surface-2); border-color: var(--tm-brand); }

/* --------------------------------------------------------------- cards */
.tmai-card { border: 1px solid var(--tm-line); border-radius: 16px; padding: 12px; background: var(--tm-surface); }
.tmai-card-title { font-weight: 600; font-size: 13px; color: var(--tm-muted); margin: 0 2px 10px; }
.tmai-videos { padding: 12px 0 10px; }
.tmai-videos .tmai-card-title { margin-left: 14px; }
.tmai-scroller { display: flex; gap: 12px; overflow-x: auto; padding: 0 12px 4px; scroll-snap-type: x mandatory; scrollbar-width: thin; }
.tmai-video { flex: none; width: 220px; color: var(--tm-text) !important; text-decoration: none !important; scroll-snap-align: start; }
.tmai-video.is-reel { width: 138px; }
.tmai-thumb { position: relative; aspect-ratio: 16 / 9; border-radius: 12px; overflow: hidden; background: var(--tm-surface-2); }
.is-reel .tmai-thumb { aspect-ratio: 9 / 16; }
.tmai-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .25s; }
.tmai-video:hover .tmai-thumb img { transform: scale(1.05); }
.tmai-dur { position: absolute; right: 6px; bottom: 6px; padding: 1px 6px; border-radius: 5px; font-size: 11px; font-weight: 700; color: #fff; background: rgba(0, 0, 0, .75); }
.tmai-badge { position: absolute; left: 6px; top: 6px; padding: 1px 7px; border-radius: 5px; font-size: 10px; font-weight: 700; text-transform: uppercase; color: #fff; background: var(--tm-brand); }
.tmai-badge.tmai-paid { left: auto; right: 6px; background: #f59e0b; }
.tmai-badge.tmai-priv { top: auto; bottom: 6px; background: rgba(0, 0, 0, .7); }
.tmai-vt { font-weight: 600; font-size: 13.5px; line-height: 1.35; margin-top: 7px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tmai-vm { font-size: 12px; color: var(--tm-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tmai-muted { color: var(--tm-muted); font-size: 12.5px; }

.tmai-channel { display: flex; align-items: center; gap: 10px; padding: 7px; border-radius: 10px; color: var(--tm-text) !important; text-decoration: none !important; }
.tmai-channel:hover { background: var(--tm-surface-2); }
.tmai-channel img { width: 42px; height: 42px; border-radius: 50%; object-fit: cover; }
.tmai-channel div { display: flex; flex-direction: column; min-width: 0; }

.tmai-row { display: flex; gap: 8px; flex-wrap: wrap; }
.tmai-btn {
  display: inline-flex; align-items: center; justify-content: center; min-height: 38px; padding: 0 16px;
  border: 1px solid var(--tm-line-strong); border-radius: 10px; background: transparent; color: var(--tm-text) !important;
  font: inherit; font-size: 14px; font-weight: 600; text-decoration: none !important; cursor: pointer;
}
.tmai-btn:hover { background: var(--tm-surface-2); }
.tmai-btn:disabled { opacity: .55; cursor: default; }
.tmai-block { display: flex; width: 100%; }
.tmai-primary { background: var(--tm-text); border-color: var(--tm-text); color: var(--tm-surface) !important; }
.tmai-dark .tmai-primary { color: #15161a !important; }
.tmai-primary:hover { background: var(--tm-text); opacity: .88; }
.tmai-red { background: var(--tm-red); border-color: var(--tm-red); color: #fff !important; }

/* upload */
.tmai-drop { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 22px 14px; text-align: center; border: 2px dashed var(--tm-line-strong); }
.tmai-drop.hover { border-color: var(--tm-brand); background: rgba(4, 171, 242, .06); }
.tmai-drop-icon { width: 40px; height: 40px; background: no-repeat center/36px url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2304abf2' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 16V4M7 9l5-5 5 5M4 16v3a1 1 0 001 1h14a1 1 0 001-1v-3'/%3E%3C/svg%3E"); }
.tmai-drop .tmai-btn { margin-top: 6px; }
.tmai-uploading { display: flex; flex-direction: column; gap: 8px; }
.tmai-uploading strong { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tmai-progress-bar { height: 6px; border-radius: 3px; background: var(--tm-surface-2); overflow: hidden; }
.tmai-progress-bar i { display: block; height: 100%; width: 0; border-radius: 3px; background: linear-gradient(90deg, #0aa8ee, #6a5cff); transition: width .25s; }
.tmai-indeterminate i { width: 35% !important; animation: tmai-slide 1.1s infinite ease-in-out; }
@keyframes tmai-slide { from { transform: translateX(-100%); } to { transform: translateX(300%); } }

/* confirm cards */
.tmai-confirm { display: flex; flex-direction: column; gap: 12px; padding: 14px; }
.tmai-danger { border-color: rgba(214, 69, 69, .45); }
.tmai-preview { display: flex; gap: 12px; align-items: center; }
.tmai-preview img { width: 132px; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 9px; background: var(--tm-surface-2); }
.tmai-preview.is-reel img { width: 70px; aspect-ratio: 9 / 16; }
.tmai-src { display: block; font-size: 12px; color: var(--tm-brand); }
.tmai-warn { font-size: 13px; padding: 9px 12px; border-radius: 10px; background: rgba(245, 158, 11, .14); color: #8a5a00; }
.tmai-dark .tmai-warn { color: #ffd98a; }
.tmai-form { display: flex; flex-direction: column; gap: 10px; }
.tmai-form label { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; font-weight: 600; color: var(--tm-muted); }
.tmai-field { width: 100%; padding: 9px 11px; border: 1px solid var(--tm-line-strong); border-radius: 10px; background: var(--tm-surface); color: var(--tm-text); font: inherit; font-size: 14px; font-weight: 400; }
.tmai-field:focus { outline: none; border-color: var(--tm-brand); box-shadow: 0 0 0 3px rgba(4, 171, 242, .18); }
textarea.tmai-field { resize: vertical; min-height: 70px; }
.tmai-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.tmai-check { flex-direction: row !important; align-items: center; gap: 6px !important; color: var(--tm-text) !important; font-weight: 400 !important; font-size: 14px !important; }
.tmai-thumbs { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; }
.tmai-tpick { flex: none; width: 80px; padding: 0; border: 2px solid transparent; border-radius: 9px; overflow: hidden; background: var(--tm-surface-2) !important; cursor: pointer; }
.tmai-tpick img { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.tmai-thumbs.is-reel .tmai-tpick { align-self: flex-start; width: 50px; }
.tmai-thumbs.is-reel .tmai-tpick img { aspect-ratio: 9 / 16; }
.tmai-tpick.on { border-color: var(--tm-brand); }
.tmai-changes { display: flex; flex-direction: column; gap: 4px; font-size: 13.5px; }
.tmai-changes del { color: var(--tm-muted); }
.tmai-status { font-size: 13.5px; font-weight: 600; }
.tmai-status:empty { display: none; }
.tmai-ok { color: var(--tm-green); }
.tmai-err { color: var(--tm-red); }
.tmai-confirm .tmai-videos { border: 0; padding: 0; background: none; }
.tmai-confirm .tmai-scroller { padding: 0; }

/* -------------------------------------------------------------- phones */
@media (max-width: 899px) {
  .tmai-side { position: absolute; top: 0; bottom: 0; left: 0; z-index: 3; box-shadow: var(--tm-shadow);
    background: var(--tm-glass); -webkit-backdrop-filter: blur(30px); backdrop-filter: blur(30px); }
  .tmai-root:not(.tmai-side-closed) .tmai-scrim { display: block; position: absolute; inset: 0; z-index: 2; background: rgba(0, 0, 0, .25); }
  .tmai-ibtn-new { display: inline-flex; }
}
@media (max-width: 600px) {
  .tmai-root { font-size: 15px; }
  .tmai-list { padding: 6px 14px 22px; gap: 18px; }
  .tmai-dock { padding: 0 10px 8px; }
  .tmai-assistant { gap: 10px; }
  .tmai-a-mark { width: 20px; height: 20px; }
  .tmai-user-bubble { max-width: 88%; }
  .tmai-video { width: 180px; }
  .tmai-video.is-reel { width: 120px; }
  .tmai-launcher { right: 14px; bottom: 76px; height: 48px; padding: 0 14px 0 12px; }
  .tmai-launcher-label { display: none; }
  .tmai-grid { grid-template-columns: 1fr 1fr; }
  .tmai-input { font-size: 16px; }   /* stops iOS zooming into the field */
  .tmai-disclaimer { display: none; }
  .tmai-is-empty .tmai-dock { padding-bottom: 6vh; }
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .tmai-overlay { background: rgba(245, 246, 250, .97); }
  .tmai-dark .tmai-overlay { background: rgba(20, 21, 25, .97); }
}
@media (prefers-reduced-motion: reduce) {
  .tmai-root *, .tmai-root *::before { animation: none !important; transition: none !important; }
  .tmai-think.is-live .tmai-think-now { color: var(--tm-text); background: none; }
}
