/* ============================================================
   TKHUB shared custom styles
   Design tokens định nghĩa trong inline Tailwind config (mỗi HTML)
   ============================================================ */

:root {
  color-scheme: dark;
  --accent: #FACC15;
  --accent-hover: #FDE047;
  --bg-base: #0A0A0B;
  --bg-raised: #111114;
  --bg-sunken: #070708;
  --bg-border: #1F1F23;
  --fg-primary: #F5F5F7;
  --fg-secondary: #A1A1AA;
  --fg-muted: #6B6B73;
}

html, body { background: var(--bg-base); color: var(--fg-primary); }
body { font-family: 'Inter', system-ui, sans-serif; overflow-x: hidden; }

.font-display { font-family: 'Space Grotesk', sans-serif; letter-spacing: -0.02em; }

/* Scrollbar */
body::-webkit-scrollbar { width: 8px; }
body::-webkit-scrollbar-track { background: var(--bg-base); }
body::-webkit-scrollbar-thumb { background: var(--bg-border); border-radius: 4px; }

/* ============ Hover patterns ============ */

/* Spotlight card */
.spotlight {
  position: relative;
  background: var(--bg-raised);
  overflow: hidden;
}
.spotlight::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(500px circle at var(--mx, 50%) var(--my, 50%), rgba(250,204,21,0.10), transparent 40%);
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
}
.spotlight:hover::before { opacity: 1; }

/* Border beam */
.beam { position: relative; isolation: isolate; }
.beam::after {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  padding: 1px;
  background: conic-gradient(from var(--angle, 0deg), transparent 0%, var(--accent) 10%, transparent 25%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0;
  transition: opacity 0.3s;
  animation: spin 4s linear infinite;
}
.beam:hover::after { opacity: 1; }
@property --angle { syntax: '<angle>'; initial-value: 0deg; inherits: false; }
@keyframes spin { to { --angle: 360deg; } }

/* Magnetic button reset */
.magnetic { transition: transform 0.3s cubic-bezier(0.23,1,0.32,1); }

/* Glow accent on CTA */
.glow-accent { box-shadow: 0 0 0 0 rgba(250,204,21,0); transition: box-shadow 0.4s; }
.glow-accent:hover { box-shadow: 0 0 50px -10px rgba(250,204,21,0.5); }

/* Image zoom */
.img-zoom { transition: transform 0.7s cubic-bezier(0.23,1,0.32,1); }
.group-card:hover .img-zoom { transform: scale(1.06); }

/* Service icon tilt */
.service-icon { transition: transform 0.6s cubic-bezier(0.23,1,0.32,1); }
.group-card:hover .service-icon { transform: rotate(-8deg) scale(1.1); }

/* ============ Custom cursor ============ */
.cursor-dot {
  position: fixed; width: 8px; height: 8px;
  background: var(--accent); border-radius: 50%;
  pointer-events: none; z-index: 9999;
  transform: translate(-50%,-50%);
  transition: opacity 0.2s, transform 0.15s;
  mix-blend-mode: difference;
}
.cursor-ring {
  position: fixed; width: 36px; height: 36px;
  border: 1.5px solid var(--accent); border-radius: 50%;
  pointer-events: none; z-index: 9998;
  transform: translate(-50%,-50%);
  transition: width 0.3s, height 0.3s, border-color 0.3s;
  mix-blend-mode: difference;
}
.cursor-ring.expand { width: 80px; height: 80px; }
@media (max-width: 768px) { .cursor-dot, .cursor-ring { display: none; } }

/* ============ Animations ============ */

/* Reveal mask */
.reveal-mask {
  clip-path: inset(0 100% 0 0);
  transition: clip-path 1.2s cubic-bezier(0.7,0,0.3,1);
}
.reveal-mask.in { clip-path: inset(0 0 0 0); }

/* Marquee */
.marquee { display: flex; animation: marquee 40s linear infinite; }
@keyframes marquee {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}
.marquee:hover { animation-play-state: paused; }

/* Pulse */
.node-pulse { animation: nodePulse 2.5s ease-in-out infinite; }
@keyframes nodePulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(250,204,21,0.6); }
  50% { box-shadow: 0 0 0 10px rgba(250,204,21,0); }
}

/* Gradient text */
.gradient-text {
  background: linear-gradient(135deg, #F5F5F7 0%, #A1A1AA 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}

/* Grid background pattern */
.grid-bg {
  background-image:
    linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px);
  background-size: 64px 64px;
}

/* ============ Form controls (shared) ============ */
.tk-input {
  width: 100%;
  background: var(--bg-raised);
  border: 1px solid var(--bg-border);
  color: var(--fg-primary);
  border-radius: 0.75rem;
  padding: 0.875rem 1rem;
  font-size: 0.9375rem;
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
}
.tk-input::placeholder { color: var(--fg-muted); }
.tk-input:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--bg-base);
  box-shadow: 0 0 0 3px rgba(250,204,21,0.15);
}
.tk-input.error {
  border-color: #EF4444;
  box-shadow: 0 0 0 3px rgba(239,68,68,0.15);
}

.tk-label {
  display: block;
  font-size: 0.8125rem;
  color: var(--fg-secondary);
  margin-bottom: 0.5rem;
  font-weight: 500;
}

.tk-radio-card {
  cursor: pointer;
  background: var(--bg-raised);
  border: 1px solid var(--bg-border);
  border-radius: 1rem;
  padding: 1.25rem;
  transition: border-color 0.2s, background 0.2s;
  position: relative;
}
.tk-radio-card:hover { border-color: var(--fg-muted); }
.tk-radio-card.selected {
  border-color: var(--accent);
  background: rgba(250,204,21,0.05);
}
.tk-radio-card.selected::after {
  content: '✓';
  position: absolute;
  top: 0.75rem; right: 0.75rem;
  width: 1.25rem; height: 1.25rem;
  background: var(--accent);
  color: var(--bg-base);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.75rem; font-weight: 700;
}

/* ============ Toast ============ */
.tk-toast {
  position: fixed;
  bottom: 1.5rem; left: 50%;
  transform: translateX(-50%) translateY(120%);
  background: var(--bg-raised);
  border: 1px solid var(--bg-border);
  border-radius: 0.75rem;
  padding: 0.875rem 1.25rem;
  display: flex; align-items: center; gap: 0.75rem;
  z-index: 10000;
  box-shadow: 0 20px 40px -10px rgba(0,0,0,0.5);
  transition: transform 0.4s cubic-bezier(0.23,1,0.32,1);
  min-width: 280px;
}
.tk-toast.show { transform: translateX(-50%) translateY(0); }
.tk-toast.success { border-color: rgba(74,222,128,0.4); }
.tk-toast.error { border-color: rgba(239,68,68,0.4); }

/* ============ Stepper ============ */
.step-circle {
  width: 2rem; height: 2rem;
  border-radius: 50%;
  background: var(--bg-raised);
  border: 1px solid var(--bg-border);
  color: var(--fg-muted);
  display: flex; align-items: center; justify-content: center;
  font-weight: 600; font-size: 0.875rem;
  transition: all 0.3s;
}
.step-circle.active {
  background: var(--accent); color: var(--bg-base); border-color: var(--accent);
}
.step-circle.done {
  background: rgba(250,204,21,0.15); color: var(--accent); border-color: var(--accent);
}
.step-bar {
  flex: 1; height: 2px;
  background: var(--bg-border);
  position: relative; overflow: hidden;
}
.step-bar::after {
  content: ''; position: absolute; inset: 0; right: auto;
  width: 0%; background: var(--accent);
  transition: width 0.5s;
}
.step-bar.filled::after { width: 100%; }

/* ============ Tracking timeline ============ */
.tk-timeline-step {
  display: flex; gap: 1rem; position: relative;
  padding-bottom: 1.5rem;
}
.tk-timeline-step:not(:last-child)::before {
  content: ''; position: absolute;
  left: 0.6875rem; top: 1.5rem; bottom: 0;
  width: 1px; background: var(--bg-border);
}
.tk-timeline-step.done:not(:last-child)::before { background: var(--accent); }
.tk-timeline-dot {
  width: 1.375rem; height: 1.375rem; flex-shrink: 0;
  border-radius: 50%; border: 2px solid var(--bg-border);
  background: var(--bg-base);
  display: flex; align-items: center; justify-content: center;
  z-index: 1;
}
.tk-timeline-step.done .tk-timeline-dot { border-color: var(--accent); background: var(--accent); }
.tk-timeline-step.done .tk-timeline-dot::after {
  content: ''; width: 0.5rem; height: 0.5rem;
  background: var(--bg-base); border-radius: 50%;
  display: none;
}
.tk-timeline-step.current .tk-timeline-dot {
  border-color: var(--accent);
  animation: nodePulse 2s ease-in-out infinite;
}

/* ============ Loader ============ */
.tk-spinner {
  width: 1rem; height: 1rem;
  border: 2px solid rgba(250,204,21,0.2);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: tk-spin 0.8s linear infinite;
  display: inline-block;
}
@keyframes tk-spin { to { transform: rotate(360deg); } }

/* ============================================================
   Breakthrough animations
   ============================================================ */

/* === Scroll progress bar (top) === */
.tk-scroll-progress {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent) 0%, #FDE047 50%, var(--accent) 100%);
  background-size: 200% 100%;
  transform-origin: 0 50%;
  transform: scaleX(0);
  z-index: 100;
  animation: shimmerProgress 3s linear infinite;
  pointer-events: none;
}
@keyframes shimmerProgress {
  from { background-position: 0% 0; }
  to { background-position: 200% 0; }
}

/* === Page transition overlay === */
.tk-page-overlay {
  position: fixed;
  inset: 0;
  background: var(--bg-base);
  z-index: 10001;
  transform: translateY(100%);
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
}
.tk-page-overlay::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 50% 50%, rgba(250,204,21,0.15), transparent 60%),
    var(--bg-base);
}
.tk-page-overlay .tk-overlay-logo {
  position: relative;
  z-index: 1;
  opacity: 0;
  transition: opacity 0.3s;
}
.tk-page-overlay.entering {
  transform: translateY(0);
  transition: transform 0.7s cubic-bezier(0.86, 0, 0.07, 1);
  pointer-events: all;
}
.tk-page-overlay.entering .tk-overlay-logo { opacity: 1; transition-delay: 0.4s; }
.tk-page-overlay.leaving {
  transform: translateY(-100%);
  transition: transform 0.7s cubic-bezier(0.86, 0, 0.07, 1);
}

/* === 3D tilt card === */
[data-tilt] {
  transform-style: preserve-3d;
  transition: transform 0.4s cubic-bezier(0.23, 1, 0.32, 1);
  will-change: transform;
}
[data-tilt] > * {
  transform: translateZ(20px);
}

/* === Text split (word/letter stagger) === */
.split-word, .split-char {
  display: inline-block;
  opacity: 0;
  transform: translateY(120%) rotate(8deg);
  transition: opacity 0.7s cubic-bezier(0.23, 1, 0.32, 1),
              transform 0.9s cubic-bezier(0.23, 1, 0.32, 1);
}
.split-word.in, .split-char.in {
  opacity: 1; transform: translateY(0) rotate(0);
}
.split-line {
  display: block;
  overflow: hidden;
  line-height: 1.05;
  padding-bottom: 0.08em;
}

/* === Particle canvas === */
.tk-particles {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

/* === Confetti canvas === */
.tk-confetti {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
}

/* === Mouse trail dots === */
.tk-trail-dot {
  position: fixed;
  width: 6px; height: 6px;
  background: var(--accent);
  border-radius: 50%;
  pointer-events: none;
  z-index: 9997;
  opacity: 0.6;
  transform: translate(-50%, -50%);
  transition: opacity 0.4s, transform 0.4s;
  mix-blend-mode: difference;
}
@media (max-width: 768px) { .tk-trail-dot { display: none; } }

/* === Service card hover liquid effect === */
.liquid-card {
  position: relative;
  overflow: hidden;
}
.liquid-card::before {
  content: '';
  position: absolute;
  width: 0; height: 0;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(250,204,21,0.18), transparent 70%);
  left: var(--lx, 50%); top: var(--ly, 50%);
  transform: translate(-50%, -50%);
  transition: width 0.6s ease-out, height 0.6s ease-out, opacity 0.4s;
  opacity: 0;
  pointer-events: none;
}
.liquid-card:hover::before {
  width: 600px; height: 600px;
  opacity: 1;
}

/* === Glitch text === */
.glitch {
  position: relative;
  display: inline-block;
}
.glitch::before, .glitch::after {
  content: attr(data-text);
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: var(--bg-base);
  opacity: 0;
  transition: opacity 0.1s;
}
.glitch:hover::before {
  opacity: 1; color: var(--accent);
  transform: translate(-2px, -2px);
  clip-path: polygon(0 0, 100% 0, 100% 45%, 0 45%);
  animation: glitchTop 0.6s steps(2) infinite;
}
.glitch:hover::after {
  opacity: 1; color: #60A5FA;
  transform: translate(2px, 2px);
  clip-path: polygon(0 55%, 100% 55%, 100% 100%, 0 100%);
  animation: glitchBot 0.6s steps(2) infinite;
}
@keyframes glitchTop {
  0%, 100% { transform: translate(-2px, -2px); }
  50% { transform: translate(2px, -1px); }
}
@keyframes glitchBot {
  0%, 100% { transform: translate(2px, 2px); }
  50% { transform: translate(-2px, 1px); }
}

/* === Marquee with drag potential === */
.marquee-wrap { cursor: grab; user-select: none; }
.marquee-wrap:active { cursor: grabbing; }

/* === SVG path draw === */
.path-draw {
  stroke-dasharray: var(--path-len, 1000);
  stroke-dashoffset: var(--path-len, 1000);
  transition: stroke-dashoffset 2s cubic-bezier(0.23, 1, 0.32, 1);
}
.path-draw.in { stroke-dashoffset: 0; }

/* === Section corner accents === */
.corner-accents { position: relative; }
.corner-accents::before,
.corner-accents::after {
  content: '';
  position: absolute;
  width: 24px; height: 24px;
  border: 1px solid var(--accent);
  opacity: 0.4;
  transition: opacity 0.3s, width 0.3s, height 0.3s;
}
.corner-accents::before {
  top: -1px; left: -1px;
  border-right: 0; border-bottom: 0;
}
.corner-accents::after {
  bottom: -1px; right: -1px;
  border-left: 0; border-top: 0;
}
.corner-accents:hover::before,
.corner-accents:hover::after {
  width: 32px; height: 32px;
  opacity: 0.9;
}

/* === Floating animation === */
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}
.float-slow { animation: float 4s ease-in-out infinite; }
.float-fast { animation: float 2.5s ease-in-out infinite; }

/* === Gradient border animated === */
.gradient-border {
  position: relative;
  border-radius: 1rem;
  padding: 1px;
  background: linear-gradient(135deg,
    rgba(250,204,21,0.4),
    rgba(96,165,250,0.2),
    rgba(167,139,250,0.3),
    rgba(250,204,21,0.4));
  background-size: 300% 300%;
  animation: gradShift 6s ease infinite;
}
.gradient-border > * {
  background: var(--bg-raised);
  border-radius: inherit;
}
@keyframes gradShift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

/* ============================================================
   Language switcher
   ============================================================ */
.tk-lang-switcher {
  position: relative;
  display: inline-flex;
  align-items: center;
}
.tk-lang-current {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.375rem 0.625rem;
  border-radius: 9999px;
  background: var(--bg-raised);
  border: 1px solid var(--bg-border);
  color: var(--fg-secondary);
  font-size: 0.75rem;
  font-weight: 500;
  transition: border-color 0.2s, color 0.2s;
  cursor: pointer;
}
.tk-lang-current:hover {
  color: var(--fg-primary);
  border-color: var(--fg-muted);
}
.tk-lang-flag {
  font-size: 1rem;
  line-height: 1;
}
.tk-lang-code {
  letter-spacing: 0.05em;
  font-family: 'Inter', sans-serif;
}
.tk-lang-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: var(--bg-raised);
  border: 1px solid var(--bg-border);
  border-radius: 0.75rem;
  padding: 0.375rem;
  min-width: 160px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: opacity 0.2s, transform 0.2s, visibility 0.2s;
  z-index: 60;
  box-shadow: 0 20px 40px -10px rgba(0,0,0,0.5);
}
.tk-lang-switcher.open .tk-lang-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.tk-lang-option {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  width: 100%;
  padding: 0.5rem 0.625rem;
  border-radius: 0.5rem;
  font-size: 0.8125rem;
  color: var(--fg-secondary);
  background: transparent;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.tk-lang-option:hover {
  background: var(--bg-base);
  color: var(--fg-primary);
}
.tk-lang-option.active {
  color: var(--accent);
}
.tk-lang-option.active::after {
  content: '✓';
  margin-left: auto;
  font-weight: 600;
}
@media (max-width: 640px) {
  .tk-lang-code { display: none; }
  .tk-lang-current { padding: 0.375rem; }
}

/* ============================================================
   Cookie consent banner (GDPR)
   ============================================================ */
.tk-cookie-banner {
  position: fixed;
  bottom: 1rem;
  left: 1rem;
  right: 1rem;
  max-width: 480px;
  background: var(--bg-raised);
  border: 1px solid var(--bg-border);
  border-radius: 1rem;
  padding: 1.25rem;
  z-index: 9000;
  box-shadow: 0 20px 50px -10px rgba(0,0,0,0.6);
  transform: translateY(120%);
  transition: transform 0.5s cubic-bezier(0.23,1,0.32,1);
}
.tk-cookie-banner.show { transform: translateY(0); }
@media (min-width: 640px) {
  .tk-cookie-banner { left: auto; }
}
.tk-cookie-banner h3 {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 600;
  font-size: 1rem;
  color: var(--fg-primary);
  margin-bottom: 0.5rem;
}
.tk-cookie-banner p {
  font-size: 0.8125rem;
  color: var(--fg-secondary);
  line-height: 1.5;
  margin-bottom: 1rem;
}
.tk-cookie-banner .tk-cookie-tiers {
  display: flex; flex-direction: column; gap: 0.5rem;
  margin-bottom: 1rem;
}
.tk-cookie-tier {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.625rem 0.875rem;
  background: var(--bg-base);
  border: 1px solid var(--bg-border);
  border-radius: 0.5rem;
  font-size: 0.8125rem;
}
.tk-cookie-tier strong { color: var(--fg-primary); font-weight: 500; }
.tk-cookie-tier .tier-meta { color: var(--fg-muted); font-size: 0.6875rem; display: block; margin-top: 2px; }
.tk-cookie-tier .tk-switch {
  position: relative; width: 32px; height: 18px;
  background: var(--bg-border); border-radius: 9999px;
  cursor: pointer; transition: background 0.2s; flex-shrink: 0;
}
.tk-cookie-tier .tk-switch::after {
  content: ''; position: absolute;
  top: 2px; left: 2px;
  width: 14px; height: 14px;
  background: var(--fg-secondary); border-radius: 50%;
  transition: transform 0.2s, background 0.2s;
}
.tk-cookie-tier .tk-switch.on { background: var(--accent); }
.tk-cookie-tier .tk-switch.on::after { background: var(--bg-base); transform: translateX(14px); }
.tk-cookie-tier .tk-switch.locked { opacity: 0.5; cursor: not-allowed; }
.tk-cookie-actions {
  display: flex; gap: 0.5rem; flex-wrap: wrap;
}
.tk-cookie-actions button {
  flex: 1; min-width: 100px;
  padding: 0.5rem 0.875rem;
  border-radius: 9999px;
  font-size: 0.8125rem; font-weight: 500;
  cursor: pointer; transition: all 0.2s;
}
.tk-cookie-actions .btn-accept-all {
  background: var(--accent); color: var(--bg-base); border: 1px solid var(--accent);
}
.tk-cookie-actions .btn-accept-all:hover { background: var(--accent-hover); }
.tk-cookie-actions .btn-save {
  background: transparent; color: var(--fg-primary); border: 1px solid var(--bg-border);
}
.tk-cookie-actions .btn-save:hover { border-color: var(--fg-muted); }
.tk-cookie-actions .btn-reject {
  background: transparent; color: var(--fg-secondary); border: 1px solid var(--bg-border);
}

/* ============================================================
   LIVE SHIPMENT TICKER
   ============================================================ */
.tk-ticker {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: 38px;
  background: linear-gradient(180deg, rgba(7,7,8,0.96), var(--bg-sunken));
  border-top: 1px solid var(--bg-border);
  z-index: 7000;
  overflow: hidden;
  display: flex; align-items: center;
  transform: translateY(100%);
  transition: transform 0.6s cubic-bezier(0.23,1,0.32,1);
  backdrop-filter: blur(8px);
  font-size: 0.75rem;
}
.tk-ticker.show { transform: translateY(0); }
.tk-ticker-label {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--accent); color: var(--bg-base);
  padding: 4px 10px; margin: 0 0.75rem;
  border-radius: 4px;
  font-weight: 600; font-size: 0.6875rem;
  letter-spacing: 0.05em; text-transform: uppercase;
  flex-shrink: 0;
}
.tk-ticker-label::before {
  content: ''; width: 6px; height: 6px;
  background: var(--bg-base); border-radius: 50%;
  animation: nodePulse 1.5s infinite;
}
.tk-ticker-track {
  display: flex;
  white-space: nowrap;
  animation: tickerScroll 60s linear infinite;
}
.tk-ticker:hover .tk-ticker-track { animation-play-state: paused; }
.tk-ticker-item {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 0 1.25rem;
  color: var(--fg-secondary);
  border-right: 1px solid var(--bg-border);
}
.tk-ticker-item strong { color: var(--fg-primary); margin: 0 4px; font-weight: 500; }
.tk-ticker-item .tk-ticker-flag { font-size: 0.875rem; }
.tk-ticker-item .tk-ticker-status { font-family: 'JetBrains Mono', monospace; font-size: 0.6875rem; padding: 1px 6px; border-radius: 4px; }
.tk-ticker-item .status-shipped { background: rgba(96,165,250,0.15); color: var(--signal-info); }
.tk-ticker-item .status-clearing { background: rgba(167,139,250,0.15); color: #A78BFA; }
.tk-ticker-item .status-delivered { background: rgba(74,222,128,0.15); color: var(--signal-success); }
.tk-ticker-item .status-onflight { background: rgba(251,146,60,0.15); color: #FB923C; }
.tk-ticker-close {
  background: transparent; border: 0; color: var(--fg-muted);
  padding: 6px 10px; cursor: pointer; transition: color 0.2s;
  flex-shrink: 0;
}
.tk-ticker-close:hover { color: var(--fg-primary); }
@keyframes tickerScroll {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

/* ============================================================
   CHAT WIDGET
   ============================================================ */
#tkChatRoot { position: fixed; bottom: 1.25rem; right: 1.25rem; z-index: 8500; font-family: 'Inter', sans-serif; }
#tkChatToggle {
  width: 56px; height: 56px; border-radius: 50%;
  background: var(--accent); color: var(--bg-base);
  border: 0; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 12px 32px -8px rgba(250,204,21,0.5);
  position: relative;
  transition: transform 0.3s cubic-bezier(0.23,1,0.32,1), box-shadow 0.3s;
}
#tkChatToggle:hover { transform: scale(1.08); }
#tkChatToggle.open { transform: rotate(360deg) scale(0.92); background: var(--bg-raised); color: var(--fg-primary); border: 1px solid var(--bg-border); }
#tkChatToggle.hint { animation: chatBounce 1.5s ease-in-out 2; }
@keyframes chatBounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}
.tk-chat-dot {
  position: absolute; top: 6px; right: 6px;
  width: 12px; height: 12px;
  background: var(--signal-success);
  border: 2px solid var(--bg-base);
  border-radius: 50%;
  animation: nodePulse 2s infinite;
}
#tkChatToggle.open .tk-chat-dot { display: none; }

#tkChatPanel {
  position: absolute; bottom: 70px; right: 0;
  width: min(360px, calc(100vw - 2.5rem));
  height: min(540px, calc(100vh - 120px));
  background: var(--bg-raised);
  border: 1px solid var(--bg-border);
  border-radius: 1rem;
  display: flex; flex-direction: column;
  opacity: 0; visibility: hidden;
  transform: translateY(10px) scale(0.95);
  transform-origin: bottom right;
  transition: opacity 0.25s, transform 0.25s cubic-bezier(0.23,1,0.32,1), visibility 0.25s;
  box-shadow: 0 24px 60px -12px rgba(0,0,0,0.6);
  overflow: hidden;
}
#tkChatPanel.open { opacity: 1; visibility: visible; transform: translateY(0) scale(1); }

.tk-chat-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--bg-border);
  background: linear-gradient(180deg, rgba(250,204,21,0.08), transparent);
}
.tk-chat-title { font-family: 'Space Grotesk', sans-serif; font-weight: 600; font-size: 0.9375rem; color: var(--fg-primary); }
.tk-chat-sub { font-size: 0.6875rem; color: var(--fg-muted); margin-top: 2px; display: flex; align-items: center; gap: 4px; }
.tk-chat-status { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--signal-success); animation: nodePulse 2s infinite; }
#tkChatClose { background: transparent; border: 0; color: var(--fg-muted); cursor: pointer; padding: 6px; border-radius: 6px; transition: all 0.2s; }
#tkChatClose:hover { color: var(--fg-primary); background: var(--bg-base); }

.tk-chat-body {
  flex: 1;
  overflow-y: auto;
  padding: 1rem 1.25rem;
  display: flex; flex-direction: column;
  gap: 0.625rem;
}
.tk-chat-msg {
  max-width: 85%;
  padding: 0.625rem 0.875rem;
  border-radius: 1rem;
  font-size: 0.8125rem;
  line-height: 1.5;
  animation: msgIn 0.3s cubic-bezier(0.23,1,0.32,1);
}
.tk-chat-msg a { color: var(--accent); border-bottom: 1px solid var(--accent); }
.tk-chat-msg strong { color: var(--fg-primary); font-weight: 600; }
.tk-chat-msg-bot {
  background: var(--bg-base);
  border: 1px solid var(--bg-border);
  align-self: flex-start;
  border-bottom-left-radius: 0.25rem;
  color: var(--fg-secondary);
}
.tk-chat-msg-user {
  background: var(--accent);
  color: var(--bg-base);
  align-self: flex-end;
  border-bottom-right-radius: 0.25rem;
  font-weight: 500;
}
@keyframes msgIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.tk-chat-typing { display: flex; gap: 4px; padding: 0.875rem 1rem; }
.tk-chat-typing span {
  width: 6px; height: 6px;
  background: var(--fg-muted);
  border-radius: 50%;
  animation: typingDot 1.2s infinite;
}
.tk-chat-typing span:nth-child(2) { animation-delay: 0.15s; }
.tk-chat-typing span:nth-child(3) { animation-delay: 0.3s; }
@keyframes typingDot {
  0%, 60%, 100% { opacity: 0.3; transform: scale(0.8); }
  30% { opacity: 1; transform: scale(1.1); }
}

.tk-chat-input {
  padding: 0.75rem 0.875rem;
  border-top: 1px solid var(--bg-border);
  display: flex; gap: 0.5rem; align-items: center;
  background: var(--bg-base);
}
.tk-chat-input input {
  flex: 1;
  background: var(--bg-raised);
  border: 1px solid var(--bg-border);
  color: var(--fg-primary);
  border-radius: 9999px;
  padding: 0.5rem 0.875rem;
  font-size: 0.8125rem;
  outline: none;
  transition: border-color 0.2s;
}
.tk-chat-input input:focus { border-color: var(--accent); }
.tk-chat-input input::placeholder { color: var(--fg-muted); }
.tk-chat-input button {
  width: 36px; height: 36px;
  background: var(--accent); color: var(--bg-base);
  border: 0; border-radius: 50%; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.2s;
}
.tk-chat-input button:hover { background: var(--accent-hover); }

@media (max-width: 640px) {
  #tkChatRoot { bottom: 0.875rem; right: 0.875rem; }
  #tkChatPanel { bottom: 64px; }
}

/* ============ Reduced motion ============ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .reveal-mask { clip-path: inset(0 0 0 0); }
  .split-word, .split-char { opacity: 1; transform: none; }
  .marquee { animation: none; }
  [data-tilt] { transform: none !important; }
}
