/* V78 Motion 1: one motion system for the existing Kalkuvia web application. */
:root {
  --kv78-ease: cubic-bezier(.22,1,.36,1);
  --kv78-fast: 160ms;
  --kv78-accent: #7956f5;
}

.kv78-motion :where(button,a,input,select,textarea) { -webkit-tap-highlight-color: transparent; }
.kv78-motion :where(button,.btn,.primary,.secondary,.kb-btn,.bc-primary,.tool-card,.popular-card,.category-card,.kv63-feature-card,.kv63-chip-row a) {
  transition: translate 220ms var(--kv78-ease),scale 160ms var(--kv78-ease),border-color 180ms ease,box-shadow 220ms ease,background-color 180ms ease;
}
.kv78-motion :where(button,.btn,.kb-btn,.tool-card,.popular-card,.category-card,.kv63-feature-card):active,
.kv78-motion .kv78-pressed { scale: .978; }
@media (hover:hover) and (pointer:fine) {
  .kv78-motion :where(.tool-card,.popular-card,.category-card,.kv63-feature-card):hover { translate: 0 -3px; }
  .kv78-motion :where(.tool-card,.popular-card):hover .tool-open,
  .kv78-motion .popular-card:hover .popular-arrow { translate: 3px 0; }
  .kv78-motion .kv63-chip-row a:hover { translate: 0 -2px; }
}
.kv78-motion :where(.tool-open,.popular-arrow,.suggestion-link>span:last-child) { transition: translate 180ms var(--kv78-ease); }
.kv78-motion :where(input,textarea,select):focus-visible { transition: border-color 160ms ease,box-shadow 180ms ease; }
.kv78-motion .kv78-ink { position: relative; overflow: hidden; isolation: isolate; }
.kv78-ripple {
  position: absolute; pointer-events: none; border-radius: 50%; z-index: 2;
  background: currentColor; opacity: 0;
  left: var(--kv78-x); top: var(--kv78-y); width: var(--kv78-size); height: var(--kv78-size);
  margin: calc(var(--kv78-size) / -2); animation: kv78-ripple 440ms ease-out;
}
@keyframes kv78-ripple { from { scale: .08; opacity: .2; } to { scale: 1; opacity: 0; } }
.kv78-motion :where(.rem-tab,.kb-tab,.bc-tabs button,.filter-pill,.nav-item,.bottom-nav a) { transition: color 180ms ease,background-color 180ms ease,scale 180ms var(--kv78-ease); }

/* Search retains immediate results. The motion is feedback, never a loading delay. */
.kv78-motion .main-search { position: relative; transition: border-color 180ms ease,box-shadow 220ms ease; }
.kv78-motion .search-icon { display: grid; place-items: center; flex: 0 0 22px; }
.kv78-motion .search-icon svg { width: 22px; height: 22px; overflow: visible; transition: color 180ms ease; }
.kv78-motion .main-search:focus-within .search-icon { color: var(--kv78-accent); }
.kv78-motion #search:focus,.kv78-motion #search:focus-visible { outline: none !important; box-shadow: none !important; border: 0 !important; }
.kv78-motion #search::-webkit-search-cancel-button { -webkit-appearance: none; display: none; }
.kv78-motion .kv78-search-flash .search-icon svg { animation: kv78-search-scan 320ms var(--kv78-ease); }
@keyframes kv78-search-scan { 0% { rotate: -12deg; scale: .88; } 60% { rotate: 7deg; scale: 1.07; } 100% { rotate: 0deg; scale: 1; } }
.kv78-search-clear {
  display: grid; place-items: center; flex: 0 0 32px; width: 32px; height: 32px; min-height: 32px;
  margin: 0; padding: 0; border: 0; border-radius: 50%; cursor: pointer;
  background: #eef0f8; color: #526080; font: 500 22px/1 system-ui;
}
.kv78-search-clear[hidden] { display: none !important; }
.kv78-search-clear:hover { background: #e8e2ff; color: #6940d9; }
.kv78-search-clear:focus-visible { outline: 2px solid var(--kv78-accent); outline-offset: 3px; }
.kv78-search-active .main-search kbd { display: none; }
.kv78-motion .suggestion-link[aria-selected="true"] { background: #f0ebff; outline: 2px solid #a18aee; outline-offset: -2px; }
.kv78-motion .suggestion-link:focus-visible { outline: 2px solid var(--kv78-accent); outline-offset: -2px; }
.kv78-motion .search-suggestions { z-index: 85; }

/* Results move directly beneath search; suggestions remain underneath results. */
.kv63-home.kv78-search-active #home>.hero { padding-bottom: 0; grid-template-columns: minmax(0,1fr); grid-template-areas: "copy"; }
.kv63-home.kv78-search-active .kv63-hero-copy { max-width: 760px; width: 100%; padding-bottom: 0; }
.kv63-home.kv78-search-active .kv63-search-wrap { max-width: 760px; }
.kv63-home.kv78-search-active .kv63-hero h1 { font-size: clamp(2rem,3.4vw,3rem); line-height: 1.05; }
.kv63-home.kv78-search-active .kv63-hero h1 br { display: none; }
.kv63-home.kv78-search-active .kv63-hero-copy>p { margin-bottom: 16px; }
.kv78-search-active :where(.kv63-hero-art,.kv63-feature-grid,.kv63-chip-row) { display: none !important; }
.kv78-search-active .kv63-hero-copy>h1,.kv78-search-active .kv63-hero-copy>p,.kv78-search-active .kv63-eyebrow { display: none !important; }
.kv78-search-active .kv63-hero { display: block !important; min-height: 0 !important; margin-bottom: 0 !important; padding-top: 16px !important; padding-bottom: 0 !important; }
.kv78-search-active .kv63-hero-copy { padding: 0 !important; }
.kv63-home.kv78-search-active #home>[data-kv78-search-hidden] { display: none !important; }
.kv63-home.kv78-search-active #toolsSection { margin-top: 20px; padding-top: 6px; }
.kv78-search-active #toolsSection { margin-top: 20px !important; padding-top: 0 !important; }
.kv78-search-active #toolsTitle { font-size: clamp(1.2rem,2vw,1.65rem); overflow-wrap: anywhere; }
.kv78-search-active .tools-head { gap: 14px; align-items: center; }
.kv78-search-active #toolsSection .tool-grid { margin-top: 18px; }
.kv78-motion #toolsTitle:focus { outline: none; }
.kv78-motion #toolsSection { scroll-margin-top: 90px; }
.kv78-motion #forYouSection { scroll-margin-top: 90px; }
.kv78-search-active #forYouSection { margin-top: 32px !important; padding-top: 22px !important; }
.kv78-search-active #forYouTitle { font-size: 1.22rem !important; line-height: 1.3 !important; }
.kv78-motion #forYouSection .section-heading>div>p { margin: 6px 0 0; font-size: .9rem; color: var(--muted,#667393); }
.kv78-intent { margin: 0 0 18px; }
.kv78-intent[hidden] { display: none !important; }
.kv78-intent>a { display: flex; align-items: center; gap: 12px; padding: 15px 18px; border: 1px solid #e1d8fb; border-radius: 16px; color: #5433ad; background: #f7f3ff; text-decoration: none; }
.kv78-intent small { display: block; margin-bottom: 3px; color: #77618f; font-size: .76rem; }
.kv78-intent strong { font-size: .94rem; }
.kv78-intent>a>span:last-child { margin-left: auto; font-size: 1.25rem; }
.kv78-motion #empty { padding: 32px 20px; }
.kv78-motion #empty>span { display: block; margin-top: 8px; }

/* Preserve dark palettes from both web and the independent finance module. */
[data-theme="dark"] .kv78-search-clear,body.dark .kv78-search-clear { background: #253250; color: #d7dded; }
[data-theme="dark"] .suggestion-link[aria-selected="true"] { background: #30284e; }
[data-theme="dark"] .kv78-intent>a,body.dark .kv78-intent>a { background: #201c38; border-color: #4a3c6c; color: #d9ccff; }
[data-theme="dark"] .kv78-intent small,body.dark .kv78-intent small { color: #b4a4d0; }
.kv78-motion[data-theme="dark"] .kv63-mobile-brand,.kv78-motion[data-theme="dark"] .kv63-mobile-brand strong { color: #f4f6ff !important; }
@media (max-width:760px) {
  .kv63-home.kv78-search-active .kv63-hero { grid-template-areas: "copy" !important; gap: 0; padding-top: 20px; }
  .kv63-home.kv78-search-active .kv63-hero h1 { font-size: 1.85rem; }
  .kv63-home.kv78-search-active #toolsSection { margin-top: 18px; }
  .kv78-search-active .tools-head { align-items: flex-start; }
  .kv78-search-active #resetFilter { flex-shrink: 0; }
  .kv78-intent>a { padding: 13px 14px; }
}
@media (prefers-reduced-motion:reduce) {
  html { scroll-behavior: auto !important; }
  .kv78-motion *,.kv78-motion *::before,.kv78-motion *::after {
    animation: none !important; transition-duration: .01ms !important; scroll-behavior: auto !important;
  }
  .kv78-motion .kv78-pressed { scale: 1; }
}
@media print {
  .kv78-motion * { animation: none !important; transition: none !important; }
  .kv78-ripple,.kv78-search-clear { display: none !important; }
}
