/* Foramind Studio — hover preview tips (tips.js): a small calm card next to an option, with a looping
   illustration of what the option does. Also the first-visit intro about the tips. */
.fmt {
  --fmt-ink: var(--ink, #1d1d1f); --fmt-muted: var(--muted, #6e6e7a); --fmt-line: var(--line, #e3e3ea);
  position: fixed; z-index: 1000; left: 0; top: 0; width: 264px; max-width: calc(100vw - 16px);
  background: #fff; border: 1px solid var(--fmt-line); border-radius: var(--r-18);
  box-shadow: 0 1px 2px rgba(20, 22, 58, .06), 0 14px 36px rgba(20, 22, 58, .14);
  padding: 8px 8px 12px; pointer-events: none; opacity: 0; transform: translateY(4px) scale(.98);
  transition: opacity .16s ease, transform .22s cubic-bezier(.16, 1, .3, 1);
  font: var(--fs-14)/1.45 var(--body, 'Figtree', system-ui, sans-serif); color: var(--fmt-ink); text-align: left;
}
.fmt.on { opacity: 1; transform: none; }
.fmt.inline { position: relative; z-index: auto; opacity: 1; transform: none; pointer-events: auto; }
.fmt-art {
  height: 124px; border-radius: var(--r-12); overflow: hidden; display: grid; place-items: center;
  background: linear-gradient(160deg, #f7f9fc 0%, #eef3fa 100%);
}
.fmt-art svg { display: block; width: 100%; height: 100%; max-width: 248px; }
.fmt-b { padding: var(--s-2) 6px 0; }
.fmt-b b { display: block; font: 600 var(--fs-14)/1.3 var(--display, 'Outfit', system-ui, sans-serif); letter-spacing: -.01em; margin-bottom: 3px; }
.fmt-b p { margin: 0; color: var(--fmt-muted); font-size: var(--fs-13); }

/* the illustration timeline: tips.js turns on the parts step by step ([data-s] = from step, [data-e] = until) */
.fmt-svg [data-s], .fmt-svg [data-e] { transform-box: fill-box; transform-origin: center; transition: opacity .35s ease, transform .5s cubic-bezier(.16, 1, .3, 1), stroke-dashoffset .7s ease; }
.fmt-svg [data-s]:not(.on), .fmt-svg [data-e]:not(.on) { opacity: 0; }
.fmt-svg .pop:not(.on) { transform: scale(.35); }
.fmt-svg .up:not(.on) { transform: translateY(9px); }
.fmt-svg .dn:not(.on) { transform: translateY(-9px); }
.fmt-svg .rt:not(.on) { transform: translateX(-12px); }
.fmt-svg .grow { transform-origin: left center; }
.fmt-svg .grow:not(.on) { transform: scaleX(0); }
.fmt-svg .draw { stroke-dasharray: 1; stroke-dashoffset: 1; }
.fmt-svg .draw.on { stroke-dashoffset: 0; }
.fmt-svg .draw:not(.on) { opacity: 1; }
/* a part that moves (instead of appearing): from its place to --tx/--ty, scaled by --sc */
.fmt-svg .mv:not(.on) { opacity: 1; transform: none; }
.fmt-svg .mv.on { transform: translate(var(--tx, 0), var(--ty, 0)) scale(var(--sc, 1)); }
/* continuous loops (no timeline) */
.fmt-svg .spin { transform-box: fill-box; transform-origin: center; animation: fmt-spin 2.4s linear infinite; }
.fmt-svg .breathe { transform-box: fill-box; transform-origin: center; animation: fmt-breathe 1.8s ease-in-out infinite; }
.fmt-svg .bob { animation: fmt-bob 1.6s ease-in-out infinite; }
.fmt-svg .blink { animation: fmt-blink 1.4s ease-in-out infinite; }
.fmt-svg .march { stroke-dasharray: 4 4; animation: fmt-march 1s linear infinite; }
.fmt-svg .wave { transform-box: fill-box; transform-origin: center bottom; animation: fmt-wave var(--w, .9s) ease-in-out infinite alternate; animation-delay: var(--wd, 0s); }
.fmt-svg .sweep { animation: fmt-sweep var(--sd, 3.2s) ease-in-out infinite; }
.fmt-svg .scan { animation: fmt-scan 3.6s ease-in-out infinite; }
/* one-second effect loops (presentation effects and transitions) */
.fmt-svg .fx1 { transform-box: fill-box; transform-origin: center; animation: var(--fx) 1s ease-in-out infinite; animation-delay: var(--fd, 0s); }
@keyframes fmt-spin { to { transform: rotate(360deg); } }
@keyframes fmt-breathe { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.12); } }
@keyframes fmt-bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }
@keyframes fmt-blink { 0%, 100% { opacity: .25; } 50% { opacity: 1; } }
@keyframes fmt-march { to { stroke-dashoffset: -8; } }
@keyframes fmt-wave { from { transform: scaleY(.25); } to { transform: scaleY(1); } }
@keyframes fmt-sweep { 0% { transform: translateX(-80px); } 60%, 100% { transform: translateX(260px); } }
@keyframes fmt-scan { 0% { transform: translate(0, 0); } 25% { transform: translate(70px, -18px); } 50% { transform: translate(120px, 14px); } 75% { transform: translate(40px, 22px); } 100% { transform: translate(0, 0); } }
@keyframes fmt-twinkle { 0%, 100% { opacity: 0; transform: scale(.3) rotate(0); } 50% { opacity: 1; transform: scale(1) rotate(45deg); } }
@keyframes fmt-glow { 0%, 100% { opacity: .15; transform: scale(.8); } 50% { opacity: .7; transform: scale(1.15); } }
@keyframes fmt-ripple { from { opacity: .8; transform: scale(.2); } to { opacity: 0; transform: scale(1.6); } }
@keyframes fmt-rise { from { opacity: 0; transform: translateY(14px); } 40% { opacity: 1; } to { opacity: 0; transform: translateY(-22px); } }
@keyframes fmt-fall { from { opacity: 0; transform: translateY(-22px); } 40% { opacity: 1; } to { opacity: 0; transform: translateY(14px); } }
@keyframes fmt-pop { 0%, 100% { transform: scale(1); } 30% { transform: scale(1.14); } 55% { transform: scale(.96); } }
@keyframes fmt-shine { from { transform: translateX(-70px) skewX(-20deg); } to { transform: translateX(90px) skewX(-20deg); } }
@keyframes fmt-trace { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@keyframes fmt-focus { 0%, 100% { transform: scale(1.5); opacity: .2; } 50% { transform: scale(1); opacity: .75; } }
@keyframes fmt-iris { from { transform: scale(0); } to { transform: scale(1.4); } }
@keyframes fmt-curtL { 0%, 15% { transform: translateX(0); } 85%, 100% { transform: translateX(-60px); } }
@keyframes fmt-curtR { 0%, 15% { transform: translateX(0); } 85%, 100% { transform: translateX(60px); } }
@keyframes fmt-wipe { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes fmt-burst { from { opacity: 1; transform: translate(0, 0) scale(.6); } to { opacity: 0; transform: translate(var(--bx), var(--by)) scale(1); } }
@keyframes fmt-ink { from { transform: scale(.1); opacity: .9; } 70% { opacity: .9; } to { transform: scale(1.3); opacity: 0; } }

/* the switch in Settings */
.tips-set-card .tips-set-row { display: flex; align-items: center; gap: 14px; margin-top: 12px; }
.tips-set-card .tips-set-row > span { flex: 1; }
.tips-set-card .tips-set-row small { display: block; color: var(--muted); }
.tips-set-card.flash { animation: fmt-flash 1.6s ease 1; }
@keyframes fmt-flash { 0%, 100% { box-shadow: var(--shadow, none); } 30% { box-shadow: 0 0 0 4px rgba(10, 108, 240, .28), var(--shadow, none); } }

/* the first-visit intro */
.fmt-intro { position: fixed; inset: 0; z-index: 900; display: grid; place-items: center; padding: 16px; background: rgba(20, 22, 58, 0); transition: background .25s ease; }
.fmt-intro.on { background: rgba(20, 22, 58, .32); }
.fmt-intro-box { width: min(620px, 100%); max-height: calc(100vh - 32px); overflow: auto; background: #fff; border-radius: var(--r-28); padding: var(--s-5) var(--s-5) 20px;
  box-shadow: 0 24px 64px rgba(20, 22, 58, .22); opacity: 0; transform: translateY(10px) scale(.98); transition: opacity .25s ease, transform .35s cubic-bezier(.16, 1, .3, 1); }
.fmt-intro.on .fmt-intro-box { opacity: 1; transform: none; }
.fmt-intro-box h2 { font-size: var(--fs-24); margin: 0 0 6px; }
.fmt-intro-box > p { margin: 0 0 16px; color: var(--muted, var(--muted)); }
.fmt-intro-demo { display: grid; grid-template-columns: minmax(0, 1fr) 264px; gap: 18px; align-items: center; padding: 16px; border-radius: var(--r-18); background: var(--surface, var(--surface)); }
.fmt-intro-demo .fmt { box-shadow: 0 1px 2px rgba(20, 22, 58, .06), 0 10px 26px rgba(20, 22, 58, .12); }
.fmt-intro-opt { display: flex; gap: 10px; align-items: center; width: 100%; padding: 12px 14px; border-radius: var(--r-12); border: 1.5px solid var(--accent, #0a6cf0); background: #fff; text-align: left; position: relative; }
.fmt-intro-opt b { display: block; font-size: var(--fs-16); }
.fmt-intro-opt small { display: block; color: var(--muted, var(--muted)); font-size: var(--fs-13); }
.fmt-intro-opt .fmt-cursor { position: absolute; right: 18px; bottom: -10px; width: 22px; height: 22px; animation: fmt-bob 1.6s ease-in-out infinite; }
.fmt-intro-hint { margin: 8px 2px 0; color: var(--muted, var(--muted)); font-size: var(--fs-13); }
.fmt-intro-set { display: flex; gap: 12px; align-items: flex-start; margin: 16px 0 0; padding: 12px 14px; border-radius: var(--r-12); border: 1px dashed var(--line-2, var(--line-2)); font-size: var(--fs-14); }
.fmt-intro-set svg { flex: none; width: 20px; height: 20px; color: var(--accent, #0a6cf0); margin-top: 1px; }
.fmt-intro-set b { color: var(--ink, var(--ink)); }
.fmt-intro-acts { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 18px; }
.fmt-intro-acts .grow { flex: 1; }
.fmt-intro-acts .link-btn { background: none; border: 0; padding: 6px 2px; color: var(--muted, var(--muted)); text-decoration: underline; text-underline-offset: 3px; }
@media (max-width: 640px) {
  .fmt-intro-box { padding: 20px 16px 16px; border-radius: var(--r-18); }
  .fmt-intro-demo { grid-template-columns: 1fr; padding: 12px; }
  .fmt-intro-demo .fmt { width: 100%; }
  .fmt-intro-acts .grow { display: none; }
  .fmt-intro-acts .btn { flex: 1; justify-content: center; }
}
@media (hover: none) { .fmt-intro-opt .fmt-cursor { display: none; } }
@media (prefers-reduced-motion: reduce) {
  .fmt, .fmt-intro, .fmt-intro-box, .fmt-svg [data-s], .fmt-svg [data-e] { transition: none !important; }
  .fmt-svg *, .fmt-intro-opt .fmt-cursor { animation: none !important; }
}
