/* Techoria assistant — floating chat widget for the landing page.
   Follows the landing's dark "slide" theme (landing.css, last :root block): navy surfaces, orange primary (like .btn.pri:
   translucent fill + orange border + soft glow), violet for the AI's own "thinking", Space Grotesk headings, JetBrains Mono labels.
   Tokens come from landing.css (--bg, --surface, --surface-2, --text, --muted, --line, --hover, --accent, --accent-ink, --accent-soft,
   --done, --glow-0, --serif, --sans, --mono); the fallbacks are the same dark values. All classes are tc-*. */
.tc-root {
  color-scheme: dark;
  --tc-bg: var(--bg, #191825); --tc-surface: var(--surface, #232232); --tc-card: var(--surface-2, #2A2939); --tc-well: #1E1D2B;
  --tc-text: var(--text, #F1EEF7); --tc-muted: var(--muted, #AEAABD); --tc-line: var(--line, rgba(255,255,255,.12)); --tc-hover: var(--hover, rgba(255,255,255,.07));
  --tc-accent: var(--accent, #F2994A); --tc-ink: var(--accent-ink, #F7B26B); --tc-soft: var(--accent-soft, rgba(242,153,74,.14));
  --tc-violet: var(--glow-0, #8B7CF6); --tc-done: var(--done, #3FC7A0); --tc-err: #F0566A;
  --tc-display: var(--serif, "Space Grotesk", "Inter", ui-sans-serif, system-ui, sans-serif);
  --tc-sans: var(--sans, "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif);
  --tc-mono: var(--mono, "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace);
  font-family: var(--tc-sans); color: var(--tc-text);
}
.tc-root *, .tc-root *::before, .tc-root *::after { box-sizing: border-box; }
.tc-root [hidden] { display: none !important; }
.tc-root button, .tc-root textarea { font: inherit; color: inherit; }

/* ── Panel (full page) ───────────────────────────────────────── */
.tc-panel { display: flex; flex-direction: column; height: 100dvh; width: 100%; max-width: 980px; margin: 0 auto; background: var(--tc-surface); border-inline: 1px solid var(--tc-line); }

.tc-head { display: flex; align-items: center; gap: 12px; padding: 14px 12px 14px 16px; border-bottom: 1px solid var(--tc-line); background: var(--tc-card); }
.tc-head img { width: 34px; height: 34px; flex: none; border-radius: 10px; object-fit: contain; }
.tc-title { flex: 1; min-width: 0; }
.tc-title strong { display: block; font-family: var(--tc-display); font-weight: 700; font-size: 1.02rem; letter-spacing: -.02em; line-height: 1.2; color: #F5F2FA; }
.tc-title span { display: block; margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-family: var(--tc-mono); font-size: .62rem; letter-spacing: .1em; text-transform: uppercase; color: var(--tc-muted); }
.tc-icon-btn { display: grid; place-items: center; width: 36px; height: 36px; flex: none; padding: 0; border: 0; border-radius: 12px; background: transparent; color: var(--tc-muted); cursor: pointer; transition: background .15s, color .15s; }
.tc-icon-btn:hover { background: var(--tc-hover); color: var(--tc-text); }
.tc-icon-btn svg { width: 19px; height: 19px; }

/* ── Messages ─────────────────────────────────────────────────── */
.tc-log { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 18px 16px 8px; background: var(--tc-well); scroll-behavior: smooth; }
.tc-log::-webkit-scrollbar { width: 8px; } .tc-log::-webkit-scrollbar-thumb { background: rgba(255,255,255,.16); border-radius: 8px; border: 2px solid var(--tc-well); }

.tc-welcome { padding: 8px 2px 6px; }
.tc-welcome h3 { font-family: var(--tc-display); font-weight: 700; font-size: 1.5rem; line-height: 1.2; letter-spacing: -.02em; color: #F5F2FA; }
.tc-welcome p { margin-top: 8px; color: var(--tc-muted); font-size: .9rem; line-height: 1.55; }
.tc-chips { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; margin-top: 18px; }
.tc-chip { padding: 9px 15px; border: 1px solid var(--tc-line); border-radius: 999px; background: rgba(255,255,255,.06); color: var(--tc-text); font-size: .85rem; font-weight: 500; text-align: left; line-height: 1.35; cursor: pointer; transition: background .15s, border-color .15s, color .15s; }
.tc-chip:hover { border-color: rgba(242,153,74,.7); background: var(--tc-soft); color: #FFD9B8; }

.tc-msg { display: flex; flex-direction: column; margin-bottom: 16px; animation: tc-in .2s ease both; }
.tc-user { align-items: flex-end; }
.tc-user .tc-bubble {
  max-width: 86%; padding: 10px 14px; border-radius: 18px 18px 6px 18px; font-size: .92rem; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere;
  background: linear-gradient(rgba(242,153,74,.2), rgba(242,153,74,.2)), var(--tc-card); border: 1px solid rgba(242,153,74,.5); color: #FFE9D6;
}
.tc-bot { align-items: stretch; }
.tc-bot .tc-body { max-width: 100%; }

/* Thinking steps — violet "AI" card, like the glowing cards of the landing */
.tc-think {
  margin-bottom: 10px; border-radius: 14px; overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--tc-violet) 42%, transparent);
  background: color-mix(in srgb, var(--tc-violet) 8%, var(--tc-card));
}
.tc-think[data-state="live"] { box-shadow: 0 0 22px color-mix(in srgb, var(--tc-violet) 20%, transparent); }
.tc-think-h { display: flex; align-items: center; gap: 9px; width: 100%; padding: 9px 12px; border: 0; background: transparent; cursor: pointer; text-align: left; }
.tc-think-h:hover { background: var(--tc-hover); }
.tc-orb { position: relative; width: 16px; height: 16px; flex: none; border-radius: 50%; background: color-mix(in srgb, var(--tc-violet) 28%, transparent); }
.tc-orb::after { content: ""; position: absolute; inset: 4px; border-radius: 50%; background: var(--tc-violet); }
.tc-think[data-state="live"] .tc-orb::before { content: ""; position: absolute; inset: -3px; border-radius: 50%; border: 2px solid var(--tc-violet); opacity: 0; animation: tc-ping 1.4s ease-out infinite; }
.tc-think[data-state="done"] .tc-orb { background: rgba(63,199,160,.18); }
.tc-think[data-state="done"] .tc-orb::after { background: var(--tc-done); }
.tc-think-t { flex: 1; font-size: .82rem; font-weight: 600; color: color-mix(in srgb, var(--tc-violet) 62%, #fff); }
.tc-think[data-state="done"] .tc-think-t { color: var(--tc-muted); }
.tc-think-n { font-family: var(--tc-mono); font-size: .7rem; color: var(--tc-muted); font-variant-numeric: tabular-nums; }
.tc-chev { width: 16px; height: 16px; flex: none; color: var(--tc-muted); transition: transform .18s; }
.tc-think[data-open="1"] .tc-chev { transform: rotate(180deg); }
.tc-steps { display: none; margin: 0; padding: 4px 14px 12px; list-style: none; max-height: 190px; overflow-y: auto; overscroll-behavior: contain; border-top: 1px solid color-mix(in srgb, var(--tc-violet) 26%, transparent); }
.tc-think[data-open="1"] .tc-steps { display: block; }
.tc-think[data-empty="1"] .tc-steps { display: none; }
.tc-steps::-webkit-scrollbar { width: 6px; } .tc-steps::-webkit-scrollbar-thumb { background: rgba(255,255,255,.16); border-radius: 6px; }
.tc-step { position: relative; display: flex; gap: 11px; padding: 9px 0 0; font-size: .8rem; line-height: 1.5; color: var(--tc-muted); }
.tc-step::before { content: ""; position: absolute; left: 7px; top: 24px; bottom: -8px; width: 1px; background: color-mix(in srgb, var(--tc-violet) 30%, transparent); }
.tc-step:last-child::before { display: none; }
.tc-mark { position: relative; z-index: 1; width: 15px; height: 15px; flex: none; margin-top: 2px; border-radius: 50%; display: grid; place-items: center; background: rgba(63,199,160,.18); color: var(--tc-done); }
.tc-mark svg { width: 9px; height: 9px; }
.tc-step[data-s="live"] .tc-mark { background: color-mix(in srgb, var(--tc-violet) 28%, transparent); }
.tc-step[data-s="live"] .tc-mark::after { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--tc-violet); animation: tc-pulse 1s ease-in-out infinite; }
.tc-step[data-s="live"] .tc-mark svg { display: none; }
.tc-step div { min-width: 0; overflow-wrap: anywhere; }
.tc-step b { font-weight: 600; color: var(--tc-text); }

/* Answer (rendered markdown) */
.tc-ans { font-size: .92rem; line-height: 1.62; overflow-wrap: anywhere; color: var(--tc-text); }
.tc-ans > :first-child { margin-top: 0; } .tc-ans > :last-child { margin-bottom: 0; }
.tc-ans p { margin: 0 0 .75em; }
.tc-ans h4 { margin: 1em 0 .4em; font-family: var(--tc-display); font-weight: 700; font-size: 1.04rem; letter-spacing: -.01em; color: #F5F2FA; }
.tc-ans ul, .tc-ans ol { margin: 0 0 .75em; padding-left: 1.3em; } .tc-ans li { margin: .2em 0; } .tc-ans li::marker { color: var(--tc-accent); }
.tc-ans strong { color: #F5F2FA; font-weight: 600; }
.tc-ans blockquote { margin: 0 0 .75em; padding: 2px 0 2px 12px; border-left: 3px solid var(--tc-accent); color: var(--tc-muted); }
.tc-ans hr { border: 0; border-top: 1px solid var(--tc-line); margin: 1em 0; }
.tc-ans a { color: #FFC892; text-decoration: underline; text-underline-offset: 2px; }
.tc-ans a:hover { color: #fff; }
.tc-ans code { padding: 1px 6px; border-radius: 6px; background: rgba(255,255,255,.09); font: .84em var(--tc-mono); }
.tc-tbl { margin: 0 0 .85em; overflow-x: auto; border: 1px solid var(--tc-line); border-radius: 12px; background: var(--tc-card); }
.tc-tbl table { width: 100%; border-collapse: collapse; font-size: .82rem; line-height: 1.45; }
.tc-tbl th, .tc-tbl td { padding: 7px 11px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--tc-line); overflow-wrap: break-word; word-break: normal; }   /* break only when a single word cannot fit; the wrapper scrolls sideways instead of cutting words */
.tc-tbl th { background: rgba(255,255,255,.05); color: var(--tc-muted); font-family: var(--tc-mono); font-size: .68rem; font-weight: 500; letter-spacing: .06em; text-transform: uppercase; white-space: nowrap; }
.tc-tbl tr:last-child td { border-bottom: 0; }
.tc-code { position: relative; margin: 0 0 .85em; border-radius: 12px; background: #14131E; border: 1px solid var(--tc-line); color: #ECE9F5; overflow: hidden; }
.tc-code pre { margin: 0; padding: 12px 14px; overflow-x: auto; font: .8rem/1.55 var(--tc-mono); }
.tc-code pre code { padding: 0; background: none; font: inherit; color: inherit; }
.tc-code-h { display: flex; align-items: center; justify-content: space-between; padding: 5px 6px 5px 14px; background: rgba(255,255,255,.05); border-bottom: 1px solid var(--tc-line); font-family: var(--tc-mono); font-size: .66rem; letter-spacing: .08em; color: var(--tc-muted); text-transform: uppercase; }
.tc-copy { padding: 3px 9px; border: 0; border-radius: 8px; background: transparent; color: var(--tc-muted); font-family: var(--tc-mono); font-size: .66rem; letter-spacing: .06em; text-transform: uppercase; cursor: pointer; }
.tc-copy:hover { background: var(--tc-hover); color: var(--tc-text); }
.tc-caret::after { content: ""; display: inline-block; width: 7px; height: 1.05em; margin-left: 2px; vertical-align: text-bottom; border-radius: 2px; background: var(--tc-accent); animation: tc-blink 1s steps(2, start) infinite; }

/* Typing indicator (before the first reasoning token arrives) */
.tc-dots { display: inline-flex; gap: 4px; padding: 6px 2px; }
.tc-dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--tc-muted); opacity: .5; animation: tc-bounce 1.1s ease-in-out infinite; }
.tc-dots i:nth-child(2) { animation-delay: .15s; } .tc-dots i:nth-child(3) { animation-delay: .3s; }

.tc-err { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 10px 12px; border-radius: 14px; background: rgba(240,86,106,.1); border: 1px solid rgba(240,86,106,.38); color: #FF9AA8; font-size: .85rem; line-height: 1.45; }
.tc-retry { padding: 5px 12px; border: 1px solid rgba(240,86,106,.5); border-radius: 10px; background: transparent; color: #FFB4BE; font-size: .8rem; font-weight: 600; cursor: pointer; }
.tc-retry:hover { background: rgba(240,86,106,.16); }

/* ── Composer ─────────────────────────────────────────────────── */
.tc-form { padding: 10px 14px 12px; border-top: 1px solid var(--tc-line); background: var(--tc-card); }
.tc-box { display: flex; align-items: flex-end; gap: 8px; padding: 6px 6px 6px 14px; border: 1px solid var(--tc-line); border-radius: 18px; background: var(--tc-well); transition: border-color .15s, box-shadow .15s; }
.tc-box:focus-within { border-color: var(--tc-violet); box-shadow: 0 0 0 3px rgba(139,124,246,.2); }
.tc-input { flex: 1; min-width: 0; max-height: 132px; padding: 8px 0; border: 0; outline: 0; resize: none; background: transparent; font-size: .93rem; line-height: 1.45; color: var(--tc-text); }
.tc-input::placeholder { color: #7F7C90; }
.tc-send {
  display: grid; place-items: center; width: 38px; height: 38px; flex: none; padding: 0; border-radius: 13px; cursor: pointer;
  background: linear-gradient(rgba(242,153,74,.2), rgba(242,153,74,.2)), var(--tc-surface); border: 1px solid rgba(242,153,74,.6); color: #FFD9B8;
  transition: background .15s, color .15s, opacity .15s, box-shadow .15s;
}
.tc-send:hover:not(:disabled) { background: var(--tc-accent); color: #1A0F06; box-shadow: 0 0 18px rgba(242,153,74,.4); }
.tc-send:disabled { opacity: .35; cursor: default; }
.tc-send svg { width: 18px; height: 18px; }
.tc-send[data-mode="stop"] { background: rgba(255,255,255,.1); border-color: rgba(255,255,255,.3); color: #fff; }
.tc-send[data-mode="stop"]:hover { background: rgba(255,255,255,.2); color: #fff; box-shadow: none; }
.tc-note { margin: 8px 4px 0; font-size: .68rem; line-height: 1.45; color: var(--tc-muted); text-align: center; }

@keyframes tc-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes tc-ping { 0% { opacity: .55; transform: scale(.8); } 100% { opacity: 0; transform: scale(1.6); } }
@keyframes tc-pulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: .45; transform: scale(.7); } }
@keyframes tc-blink { to { visibility: hidden; } }
@keyframes tc-bounce { 0%, 60%, 100% { transform: translateY(0); opacity: .4; } 30% { transform: translateY(-4px); opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  .tc-root *, .tc-root *::before, .tc-root *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}


/* ── Page ─────────────────────────────────────────────────────── */
:root { color-scheme: dark; }
html, body { margin: 0; height: 100%; background: #191825; }
body { font-family: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif; color: #F1EEF7; -webkit-font-smoothing: antialiased; }
#app { height: 100dvh; }
.tc-log { padding: 22px clamp(14px, 4vw, 32px) 10px; }
.tc-head { padding-top: max(14px, env(safe-area-inset-top)); }
.tc-form { padding: 10px clamp(12px, 3vw, 28px) max(12px, env(safe-area-inset-bottom)); }
.tc-msg { max-width: 100%; }
.tc-user .tc-bubble { max-width: min(86%, 640px); }
.tc-input { font-size: .96rem; }
@media (max-width: 560px) { .tc-input { font-size: 16px; } .tc-panel { border-inline: 0; } }
.tc-clip { width: 38px; height: 38px; border-radius: 13px; }
.tc-box { align-items: flex-end; padding: 6px 6px 6px 6px; }
.tc-imgs { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; margin-bottom: 6px; max-width: 86%; }
.tc-imgs img { max-width: 160px; max-height: 140px; border-radius: 12px; border: 1px solid var(--tc-line); object-fit: cover; }
.tc-imgn { margin-bottom: 4px; font: .72rem var(--tc-mono); color: var(--tc-muted); }
.tc-attach { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.tc-att { position: relative; }
.tc-att img { display: block; width: 64px; height: 64px; object-fit: cover; border-radius: 10px; border: 1px solid var(--tc-line); }
.tc-att button { position: absolute; top: -6px; right: -6px; width: 20px; height: 20px; padding: 0; border-radius: 50%; border: 1px solid var(--tc-line); background: var(--tc-card); color: var(--tc-text); font-size: 14px; line-height: 1; cursor: pointer; }
.tc-steps { max-height: 260px; }

/* ── Settings drawer ──────────────────────────────────────────── */
.st-back { position: fixed; inset: 0; z-index: 70; background: rgba(5,5,12,.6); }
.st { position: fixed; z-index: 71; top: 0; right: 0; bottom: 0; width: min(440px, 100vw); display: flex; flex-direction: column; background: var(--tc-surface); border-left: 1px solid rgba(255,255,255,.14); box-shadow: -20px 0 60px rgba(0,0,0,.5); }
.st-h { display: flex; align-items: center; justify-content: space-between; padding: 14px 12px 14px 18px; border-bottom: 1px solid var(--tc-line); background: var(--tc-card); font-family: var(--tc-display); font-size: 1.02rem; }
.st-b { flex: 1; overflow-y: auto; padding: 16px 18px 20px; display: flex; flex-direction: column; gap: 14px; }
.st-l { display: flex; flex-direction: column; gap: 6px; font: 500 .72rem var(--tc-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--tc-muted); }
.st-l small { font: .76rem/1.4 var(--tc-sans); letter-spacing: 0; text-transform: none; color: #8F8CA1; }
.st-l code { font: .74rem var(--tc-mono); padding: 1px 5px; border-radius: 5px; background: rgba(255,255,255,.08); }
.st input:not([type=checkbox]), .st textarea, .lg input { width: 100%; padding: 10px 12px; border: 1px solid var(--tc-line); border-radius: 12px; background: var(--tc-well); color: var(--tc-text); font: .92rem var(--tc-sans); letter-spacing: 0; text-transform: none; outline: 0; }
.st textarea { resize: vertical; min-height: 84px; }
.st input:focus, .st textarea:focus, .lg input:focus { border-color: var(--tc-violet); box-shadow: 0 0 0 3px rgba(139,124,246,.2); }
.st-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.st-sw { display: flex; align-items: center; gap: 10px; font-size: .9rem; cursor: pointer; }
.st-sw input { width: 18px; height: 18px; accent-color: var(--tc-accent); }
.st-msg { min-height: 1.3em; font-size: .84rem; line-height: 1.45; overflow-wrap: anywhere; color: var(--tc-muted); }
.st-msg[data-k=ok] { color: var(--tc-done); } .st-msg[data-k=err] { color: #FF9AA8; }
.st-act { display: flex; gap: 10px; justify-content: flex-end; position: sticky; bottom: -20px; margin: 0 -18px -20px; padding: 12px 18px 16px; background: var(--tc-surface); border-top: 1px solid var(--tc-line); }
.st-btn { padding: 10px 18px; border: 1px solid var(--tc-line); border-radius: 12px; background: rgba(255,255,255,.06); color: var(--tc-text); font: 600 .88rem var(--tc-sans); cursor: pointer; transition: background .15s, border-color .15s; }
.st-btn:hover { background: var(--tc-hover); }
.st-pri { background: linear-gradient(rgba(242,153,74,.2), rgba(242,153,74,.2)), var(--tc-surface); border-color: rgba(242,153,74,.6); color: #FFD9B8; }
.st-pri:hover { background: var(--tc-accent); color: #1A0F06; }
.st-link { padding: 0; border: 0; background: none; color: #FFC892; text-decoration: underline; cursor: pointer; font: inherit; }
.st button:focus-visible, .lg button:focus-visible { outline: 2px solid var(--tc-accent); outline-offset: 3px; }

/* ── Login ────────────────────────────────────────────────────── */
body.lg { display: grid; place-items: center; min-height: 100dvh; padding: 20px; background: radial-gradient(900px 500px at 50% -10%, rgba(139,124,246,.16), transparent), #191825; --tc-line: rgba(255,255,255,.12); --tc-well: #1E1D2B; --tc-text: #F1EEF7; --tc-muted: #AEAABD; --tc-violet: #8B7CF6; --tc-accent: #F2994A; --tc-tc-display: "Space Grotesk"; }
.lg-card { width: min(380px, 100%); padding: 30px 26px 26px; border-radius: 20px; background: #232232; border: 1px solid rgba(255,255,255,.14); box-shadow: 0 0 0 1px rgba(139,124,246,.16), 0 0 60px rgba(139,124,246,.12), 0 30px 80px rgba(0,0,0,.6); }
.lg-card img { border-radius: 12px; }
.lg-card h1 { margin: 14px 0 2px; font: 700 1.55rem "Space Grotesk", "Inter", sans-serif; letter-spacing: -.02em; color: #F5F2FA; }
.lg-card p { margin: 0 0 18px; color: var(--tc-muted); font-size: .9rem; }
.lg-card form { display: flex; flex-direction: column; gap: 14px; }
.lg-card label { display: flex; flex-direction: column; gap: 6px; font: 500 .72rem "JetBrains Mono", monospace; letter-spacing: .08em; text-transform: uppercase; color: var(--tc-muted); }
.lg-card input { font-size: 16px; }
.lg-m { min-height: 1.2em; color: #FF9AA8; font-size: .85rem; }
.lg-card button { padding: 12px; border-radius: 12px; border: 1px solid rgba(242,153,74,.6); background: linear-gradient(rgba(242,153,74,.2), rgba(242,153,74,.2)), #232232; color: #FFD9B8; font: 600 .95rem "Inter", sans-serif; cursor: pointer; }
.lg-card button:hover:not(:disabled) { background: #F2994A; color: #1A0F06; }
.lg-card button:disabled { opacity: .5; }

.tc-step-in { animation: tc-step-in .28s ease both; }
@keyframes tc-step-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
