/* ClicksDoc toolbar hover cards: a looping mini-scene (select the word → click the tool → result).
   Shared by the practice page and every ClicksDoc exam; built by js/cdoc-tips.js. */
.cdoc-tip {
  --g: #7c3aed;
  --tip-t: 4.2s;
  position: fixed;
  z-index: 1200;
  width: 15.6rem;
  max-width: calc(100vw - 16px);
  display: grid;
  gap: 0.55rem;
  padding: 0.75rem 0.75rem 0.65rem;
  border-radius: 20px;
  background:
    radial-gradient(120% 70% at 0% 0%, color-mix(in srgb, var(--g) 16%, transparent), transparent 60%),
    var(--card-bg, #fff);
  color: var(--ink, #1e1b4b);
  font-family: 'Nunito', sans-serif;
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--g) 35%, transparent), 0 24px 44px -18px color-mix(in srgb, var(--g) 70%, #000), 0 6px 14px -8px rgb(0 0 0 / 0.25);
  pointer-events: none;
  opacity: 0;
  transform: translateY(-6px) scale(0.92);
  transform-origin: var(--ax, 50%) top;
  transition: opacity 0.18s ease, transform 0.32s cubic-bezier(.34,1.56,.64,1);
}
.cdoc-tip.is-above { transform-origin: var(--ax, 50%) bottom; transform: translateY(6px) scale(0.92); }
.cdoc-tip.is-in { opacity: 1; transform: none; }
.cdoc-tip::before { /* arrow */
  content: "";
  position: absolute;
  top: -7px;
  left: calc(var(--ax, 50%) - 7px);
  width: 14px; height: 14px;
  background: var(--card-bg, #fff);
  transform: rotate(45deg);
  border-radius: 3px 0 0 0;
  box-shadow: -2px -2px 0 0 color-mix(in srgb, var(--g) 35%, transparent);
}
.cdoc-tip.is-above::before { top: auto; bottom: -7px; border-radius: 0 0 3px 0; box-shadow: 2px 2px 0 0 color-mix(in srgb, var(--g) 35%, transparent); }

.cdoc-tip-head { display: flex; align-items: center; gap: 0.5rem; }
.cdoc-tip-emo {
  display: grid; place-items: center; flex: none;
  width: 2.1rem; height: 2.1rem;
  border-radius: 12px;
  font-size: 1.2rem;
  background: color-mix(in srgb, var(--g) 15%, transparent);
  animation: cdocTipBob 1.8s ease-in-out infinite;
}
@keyframes cdocTipBob { 0%, 100% { transform: translateY(0) rotate(0); } 50% { transform: translateY(-3px) rotate(-6deg); } }
.cdoc-tip-title { font: 700 1.05rem/1.2 'Fredoka', 'Nunito', sans-serif; color: var(--g); }
.cdoc-tip kbd {
  margin-inline-start: auto;
  padding: 0.1rem 0.4rem;
  border-radius: 6px;
  font: 700 0.68rem/1.4 ui-monospace, monospace;
  color: var(--ink, #1e1b4b);
  background: color-mix(in srgb, var(--ink, #000) 7%, transparent);
  box-shadow: inset 0 -2px 0 color-mix(in srgb, var(--ink, #000) 18%, transparent);
  white-space: nowrap;
}
.cdoc-tip-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* the stage: mini toolbar on top, mini page below, a cursor that does the gesture */
.cdoc-tip-stage {
  position: relative;
  height: 7.6rem;
  border-radius: 14px;
  overflow: hidden;
  background: linear-gradient(160deg, color-mix(in srgb, var(--g) 22%, var(--card-bg, #fff)), color-mix(in srgb, var(--g) 8%, var(--card-bg, #fff)));
  box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--g) 25%, transparent);
}
.cdoc-tip-bar {
  position: absolute; top: 0.45rem; left: 50%; transform: translateX(-50%);
  display: flex; align-items: center; gap: 0.3rem;
  padding: 0.22rem 0.35rem;
  border-radius: 12px;
  background: var(--card-bg, #fff);
  box-shadow: 0 4px 10px -6px color-mix(in srgb, var(--g) 60%, #000);
}
.cdoc-tip-bar > i { width: 1.15rem; height: 1.15rem; border-radius: 6px; background: color-mix(in srgb, var(--g) 12%, transparent); }
.cdoc-tip-key {
  position: relative;
  display: grid; place-items: center;
  min-width: 1.75rem; height: 1.75rem; padding: 0 0.2rem;
  border-radius: 8px;
  font: 800 0.95rem/1 'Fredoka', 'Nunito', sans-serif;
  color: #fff;
  background: linear-gradient(135deg, var(--g), color-mix(in srgb, var(--g) 60%, #fff));
  box-shadow: 0 3px 0 color-mix(in srgb, var(--g) 60%, #000);
  animation: cdocTipKey var(--tip-t) ease-in-out infinite;
}
.cdoc-tip-key svg { width: 1.05rem; height: 1.05rem; fill: none; stroke: currentColor; stroke-width: 2.3; stroke-linecap: round; stroke-linejoin: round; }
.cdoc-tip-key small { font-size: 0.6em; margin-inline-start: 1px; }
.cdoc-tip-key .cdoc-swbar { display: none; }
.cdoc-tip-key::after { /* click ripple */
  content: ""; position: absolute; inset: -3px;
  border-radius: 10px;
  border: 2.5px solid var(--g);
  opacity: 0;
  animation: cdocTipRipple var(--tip-t) ease-out infinite;
}
.cdoc-tip-page {
  position: absolute; left: 0.6rem; right: 0.6rem; top: 2.85rem; bottom: 0.55rem;
  display: grid; place-items: center;
  border-radius: 10px;
  background:
    repeating-linear-gradient(transparent 0 1.2rem, color-mix(in srgb, var(--g) 10%, transparent) 1.2rem calc(1.2rem + 1px)),
    var(--card-bg, #fff);
  box-shadow: 0 6px 14px -10px rgb(0 0 0 / 0.35);
  animation: cdocTipPage var(--tip-t) ease-out infinite;
}
.cdoc-tip-word {
  position: relative; isolation: isolate;
  display: inline-grid;
  font: 400 1.3rem/1.2 'Nunito', sans-serif;
}
.cdoc-tip-word::before { /* the selection the cursor drags */
  content: ""; position: absolute; inset: -0.08rem -0.3rem; z-index: -1;
  border-radius: 5px;
  background: color-mix(in srgb, #3b82f6 32%, transparent);
  transform: scaleX(0); transform-origin: left;
  animation: cdocTipSel var(--tip-t) ease-in-out infinite;
}
.is-nosel .cdoc-tip-word::before { display: none; }
.cdoc-tip-a, .cdoc-tip-b { grid-area: 1 / 1; justify-self: center; align-self: center; white-space: nowrap; }
.cdoc-tip-a { animation: cdocTipA var(--tip-t) ease-in-out infinite; }
.cdoc-tip-b { animation: cdocTipB var(--tip-t) cubic-bezier(.34,1.56,.64,1) infinite; }
.cdoc-tip-spark {
  position: absolute; top: 0.35rem; left: 20%;
  font-size: 1.1rem;
  opacity: 0;
  animation: cdocTipSpark var(--tip-t) ease-out infinite;
}
.cdoc-tip-hand {
  position: absolute; z-index: 2;
  width: 1.45rem; height: 1.45rem;
  margin: -0.15rem 0 0 -0.3rem; /* puts the arrow's tip on the point */
  fill: #fff; stroke: #1e1b4b; stroke-width: 1.6; stroke-linejoin: round;
  filter: drop-shadow(0 3px 3px rgb(0 0 0 / 0.3));
  animation: cdocTipHand var(--tip-t) ease-in-out infinite;
}
.is-nosel .cdoc-tip-hand { animation-name: cdocTipHandN; }

/* step pictograms: select → click → bravo, lit in time with the scene */
.cdoc-tip-steps { display: flex; justify-content: center; align-items: center; gap: 0.3rem; }
.cdoc-tip-steps i {
  font-style: normal; font-size: 0.95rem;
  display: grid; place-items: center;
  width: 1.9rem; height: 1.9rem; border-radius: 999px;
  opacity: 0.35; filter: grayscale(1);
}
.cdoc-tip-steps i:nth-of-type(1) { animation: cdocTipS1 var(--tip-t) ease-in-out infinite; }
.cdoc-tip-steps i:nth-of-type(2) { animation: cdocTipS2 var(--tip-t) ease-in-out infinite; }
.cdoc-tip-steps i:nth-of-type(3) { animation: cdocTipS3 var(--tip-t) ease-in-out infinite; }
.cdoc-tip-steps b { color: color-mix(in srgb, var(--g) 55%, transparent); font-weight: 800; }
.cdoc-tip-steps.is-nosel i:first-child, .cdoc-tip-steps.is-nosel i:first-child + b { display: none; }

/* timeline (all share --tip-t): 8-36% select · 42-56% go to the tool · 58% click · 62-90% result */
@keyframes cdocTipHand {
  0%       { left: 74%; top: 96%; opacity: 0; transform: scale(1); }
  8%, 14%  { left: 38%; top: 66%; opacity: 1; }
  36%, 42% { left: 62%; top: 66%; }
  56%      { left: 50%; top: 18%; transform: scale(1); }
  59%      { transform: scale(0.8); }
  64%      { left: 50%; top: 18%; transform: scale(1); }
  82%      { left: 80%; top: 92%; opacity: 1; }
  90%, 100% { left: 80%; top: 92%; opacity: 0; }
}
@keyframes cdocTipHandN {
  0%       { left: 80%; top: 98%; opacity: 0; transform: scale(1); }
  14%, 30% { left: 70%; top: 76%; opacity: 1; }
  56%      { left: 50%; top: 18%; transform: scale(1); }
  59%      { transform: scale(0.8); }
  64%      { left: 50%; top: 18%; transform: scale(1); }
  82%      { left: 80%; top: 92%; opacity: 1; }
  90%, 100% { left: 80%; top: 92%; opacity: 0; }
}
@keyframes cdocTipSel {
  0%, 14%  { transform: scaleX(0); opacity: 1; }
  36%, 61% { transform: scaleX(1); opacity: 1; }
  68%      { transform: scaleX(1); opacity: 0; }
  100%     { transform: scaleX(0); opacity: 0; }
}
@keyframes cdocTipKey {
  0%, 55%, 72%, 100% { transform: scale(1); filter: none; }
  59% { transform: translateY(2px) scale(0.84); box-shadow: 0 1px 0 color-mix(in srgb, var(--g) 60%, #000); filter: brightness(1.15); }
  65% { transform: scale(1.12); }
}
@keyframes cdocTipRipple {
  0%, 58% { opacity: 0; transform: scale(0.8); }
  60%     { opacity: 0.9; transform: scale(1); }
  76%, 100% { opacity: 0; transform: scale(1.9); }
}
@keyframes cdocTipA {
  0%, 61%  { opacity: 1; transform: scale(1); }
  65%, 94% { opacity: 0; transform: scale(0.6); }
  100%     { opacity: 1; transform: scale(1); }
}
@keyframes cdocTipB {
  0%, 61%  { opacity: 0; transform: scale(0.4); }
  68%      { opacity: 1; transform: scale(1.25); }
  74%, 92% { opacity: 1; transform: scale(1); }
  97%, 100% { opacity: 0; transform: scale(1); }
}
@keyframes cdocTipSpark {
  0%, 62% { opacity: 0; transform: scale(0) rotate(0); }
  70%     { opacity: 1; transform: scale(1.3) rotate(25deg); }
  86%, 100% { opacity: 0; transform: scale(0.6) translateY(-8px) rotate(70deg); }
}
@keyframes cdocTipPage {
  0%, 62%, 84%, 100% { box-shadow: 0 6px 14px -10px rgb(0 0 0 / 0.35); }
  68% { box-shadow: 0 0 0 3px color-mix(in srgb, var(--g) 45%, transparent), 0 6px 18px -6px var(--g); }
}
@keyframes cdocTipS1 { 0%, 8%, 42%, 100% { opacity: 0.35; filter: grayscale(1); transform: none; background: none; } 14%, 36% { opacity: 1; filter: none; transform: scale(1.15); background: color-mix(in srgb, var(--g) 16%, transparent); } }
@keyframes cdocTipS2 { 0%, 46%, 68%, 100% { opacity: 0.35; filter: grayscale(1); transform: none; background: none; } 54%, 62% { opacity: 1; filter: none; transform: scale(1.15); background: color-mix(in srgb, var(--g) 16%, transparent); } }
@keyframes cdocTipS3 { 0%, 62%, 96%, 100% { opacity: 0.35; filter: grayscale(1); transform: none; background: none; } 68%, 90% { opacity: 1; filter: none; transform: scale(1.15); background: color-mix(in srgb, var(--g) 16%, transparent); } }

/* table-menu options: the tip sits beside the menu, arrow pointing at the option */
.cdoc-tip.is-side { transform-origin: left var(--ay, 50%); transform: translateX(-8px) scale(0.92); }
.cdoc-tip.is-side.is-left { transform-origin: right var(--ay, 50%); transform: translateX(8px) scale(0.92); }
.cdoc-tip.is-side.is-in { transform: none; }
.cdoc-tip.is-side::before { top: calc(var(--ay, 50%) - 7px); left: -7px; border-radius: 0 0 0 3px; box-shadow: -2px 2px 0 0 color-mix(in srgb, var(--g) 35%, transparent); }
.cdoc-tip.is-side.is-left::before { left: auto; right: -7px; border-radius: 0 3px 0 0; box-shadow: 2px -2px 0 0 color-mix(in srgb, var(--g) 35%, transparent); }
.cdoc-tip-sw { display: block; width: 1.05rem; height: 1.05rem; border-radius: 5px; box-shadow: 0 0 0 2px #fff; }
.cdoc-tip .mt { /* mini table: the gap is the border */
  display: inline-grid; grid-template-columns: repeat(var(--c), 1.25rem);
  gap: var(--bw, 1px); padding: var(--bw, 1px);
  background: var(--bc, #94a3b8); border-radius: 3px;
  vertical-align: middle;
}
.cdoc-tip .mt i { display: block; height: 0.8rem; background: var(--cf, #fff); }
.cdoc-tip .mt.full { grid-template-columns: repeat(var(--c), 1fr); width: 100%; }
.cdoc-tip .mtp { display: flex; width: 8.5rem; padding: 0.25rem; border: 1.5px dashed color-mix(in srgb, var(--g) 45%, transparent); border-radius: 5px; }
.cdoc-tip .mt1 { display: grid; width: 2.6rem; height: 2.3rem; padding: 0.25rem; background: #fff; border: 1.5px solid #94a3b8; border-radius: 3px; }
.cdoc-tip .mt1 b { display: block; height: 4px; border-radius: 2px; background: var(--g); }
.cdoc-tip .mt-gone { font-size: 1.5rem; }

/* mini-demo helpers used inside the word (see TIPS in cdoc-tips.js) */
.cdoc-tip .x { color: #e11d48; text-decoration: line-through; }
.cdoc-tip .w { text-decoration: underline wavy #e11d48; }
.cdoc-tip .l { display: inline-block; text-align: start; font-size: 0.72rem; line-height: 1.2; }
.cdoc-tip .l hr { margin: 0.12rem 0; border: none; border-top: 2px solid var(--g); }
.cdoc-tip-bars { display: inline-flex; flex-direction: column; align-items: var(--al); gap: 3px; width: 3rem; }
.cdoc-tip-bars i { display: block; height: 4px; border-radius: 2px; background: var(--g); width: 100%; }
.cdoc-tip-bars i:nth-child(2) { width: 65%; }
.cdoc-tip-bars i:nth-child(3) { width: 85%; }
.cdoc-tip-bars[style*="stretch"] i { width: 100%; }
.cdoc-tip .tb { display: inline-grid; grid-template-columns: 1fr 1fr; border: 1.5px solid var(--g); border-radius: 4px; font-size: 0.65rem; }
.cdoc-tip .tb i { font-style: normal; min-width: 1.6rem; min-height: 0.9rem; border: 1px solid color-mix(in srgb, var(--g) 40%, transparent); }
.cdoc-tip .kb i { font-style: normal; padding: 0.05rem 0.4rem; border-radius: 6px; box-shadow: inset 0 -2px 0 color-mix(in srgb, var(--g) 50%, transparent), 0 0 0 1.5px color-mix(in srgb, var(--g) 40%, transparent); }

@media (prefers-reduced-motion: reduce) { /* no motion: show before → after side by side */
  .cdoc-tip, .cdoc-tip * { animation: none !important; transition: none !important; }
  .cdoc-tip-word { display: inline-flex; gap: 0.9rem; align-items: center; }
  .cdoc-tip-a { opacity: 0.45; }
  .cdoc-tip-hand, .cdoc-tip-spark { display: none; }
  .cdoc-tip-steps i { opacity: 1; filter: none; }
}
@media print { .cdoc-tip { display: none !important; } }

/* Find / replace bar (shared by every ClicksDoc page): painted hits + live counter */
::highlight(cdoc-find) { background-color: #fde68a; }
::highlight(cdoc-find-cur) { background-color: #fb923c; color: #fff; }
.cdoc-find-field {
  position: relative;
  display: flex; align-items: center; gap: 0.35rem;
  flex: 1 1 11rem;
  font-size: 1.05rem;
}
.cdoc-find-field input { flex: 1 1 auto; min-width: 0; }
.cdoc-find-count {
  position: absolute; inset-inline-end: 0.45rem; top: 50%; transform: translateY(-50%);
  min-width: 1.6rem; padding: 0.05rem 0.45rem;
  border-radius: 999px;
  font: 800 0.75rem/1.4 'Fredoka', 'Nunito', sans-serif; text-align: center;
  color: #fff; background: #16a34a;
  animation: cdocFindPop 0.25s cubic-bezier(.34,1.56,.64,1);
}
.cdoc-find-count.is-zero { background: #dc2626; }
.cdoc-find-count[hidden] { display: none; }
@keyframes cdocFindPop { from { transform: translateY(-50%) scale(0.4); } }
.cdoc-find-arrow { font-weight: 800; color: #f59e0b; }
[dir="rtl"] .cdoc-find-arrow { transform: scaleX(-1); }
.cdoc-find-all { color: #fff; background: linear-gradient(135deg, #f97316, #f59e0b); border: none; }
@media (prefers-reduced-motion: reduce) { .cdoc-find-count { animation: none; } }
