/* tool-bh.css — Backlink History Checker (marketing/tool-bh.blade.php).
   Sits on home.css (hm-) and tool-v2.css (tv-). Every block is fully visible at
   rest; animations only replay it. */

.bh { --up: #19b66a; --up-ink: #138a52; --up-bg: #e7f8ef; --dn: #d64545; --dn-ink: #b0312b; --dn-bg: #fdeeee; --hist: #ff6a00; }

/* shared */
.bh-split { display: grid; grid-template-columns: 1fr 1.05fr; gap: 56px; align-items: center; }
.bh-split--flip > :first-child { order: 2; }
.bh-split h2 { margin-top: 14px; }
.bh .bh-lead { margin: 14px 0 0; font-size: 17px; line-height: 1.6; color: var(--hm-muted); }
.bh-lead a { color: var(--hm-orange-ink); font-weight: 600; }
.bh-bul { list-style: none; margin: 20px 0 0; padding: 0; display: grid; gap: 10px; }
.bh-bul li { display: flex; gap: 10px; align-items: flex-start; font-size: 15.5px; line-height: 1.5; color: var(--hm-ink2); }
.bh-bul--row { grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 26px; }
.bh figcaption em, .bh-total figcaption em { font-style: normal; font: 700 10px/1 var(--hm-fb); letter-spacing: 1.1px; text-transform: uppercase; color: var(--hm-faint); }

/* ================= HERO: total over time ================= */
.bh-total { margin: 0; padding: 18px; border-radius: 24px; background: #fff; border: 1px solid var(--hm-line); box-shadow: var(--hm-shadow); display: grid; gap: 10px; }
.bh-total__top { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
.bh-total__top small { display: block; font: 700 11px/1 var(--hm-fb); letter-spacing: 1.2px; text-transform: uppercase; color: var(--hm-faint); }
.bh-total__top b { display: block; margin-top: 6px; font: 800 44px/1 var(--hm-fb); letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.bh-total__chips { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.bh-total__chips span { font: 700 13px/1 var(--hm-fb); padding: 7px 10px; border-radius: 999px; }
.bh-total__chips .up { background: var(--up-bg); color: var(--up-ink); } .bh-total__chips .dn { background: var(--dn-bg); color: var(--dn-ink); }
.bh-total__chips em { font-style: normal; font-size: 12px; color: var(--hm-faint); }
.bh-total__chart { width: 100%; height: 170px; display: block; overflow: visible; }
.bh-grid { stroke: #eef0f5; stroke-width: 1; }
.bh-total__line { stroke-dasharray: 1; animation: bhDraw 1.6s cubic-bezier(.4,0,.2,1) .3s both; }
@keyframes bhDraw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
.bh-total__x { display: grid; grid-template-columns: repeat(12, 1fr); font: 700 10px/1 var(--hm-fb); color: var(--hm-faint); text-align: center; }
.bh-total figcaption { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 12.5px; color: var(--hm-muted); }

/* ================= FIRST / LAST SEEN ================= */
.bh-bio { margin: 0; padding: 16px; border-radius: 22px; background: var(--hm-soft); border: 1px solid var(--hm-line); display: grid; gap: 8px; }
.bh-bio__h { display: grid; grid-template-columns: 1fr 1fr 64px; gap: 12px; padding: 0 12px 4px; font: 700 10.5px/1 var(--hm-fb); letter-spacing: 1px; text-transform: uppercase; color: var(--hm-faint); }
.bh-bio__r { --c: var(--up); display: grid; grid-template-columns: 1fr 1fr 64px; gap: 12px; align-items: center; padding: 12px; border-radius: 14px; background: #fff; border: 1px solid var(--hm-line); }
.bh-bio__r.is-new { --c: #2f5fe0; } .bh-bio__r.is-lost { --c: var(--dn); background: #fffafa; border-color: #f6d6d6; }
.bh-bio__d { display: grid; gap: 3px; min-width: 0; }
.bh-bio__d b { font: 700 13.5px/1.25 var(--hm-fb); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bh-bio__d small { font-size: 12px; color: var(--hm-faint); }
.bh-bio__fl { display: grid; gap: 4px; }
.bh-bio__fl span { display: flex; justify-content: space-between; gap: 8px; font: 600 12.5px/1.2 var(--hm-fs); color: var(--hm-ink2); padding: 4px 8px; border-radius: 7px; background: var(--hm-soft); }
.bh-bio__fl em { font-style: normal; font: 700 10px/1.2 var(--hm-fb); letter-spacing: .5px; text-transform: uppercase; color: var(--hm-faint); }
.bh-bio__r.is-new .first { background: #eaf0ff; color: #2448b8; }
.bh-bio__r.is-lost .last { background: var(--dn-bg); color: var(--dn-ink); }
.bh-st { justify-self: end; font: 800 11px/1 var(--hm-fb); padding: 6px 9px; border-radius: 999px; color: #fff; background: var(--c); }
.bh-bio figcaption { padding: 6px 4px 0; font-size: 13px; line-height: 1.5; color: var(--hm-muted); }
.bh-bio.is-in .bh-bio__r { animation: bhRise .45s cubic-bezier(.2,.8,.2,1) both; animation-delay: calc(var(--i) * .12s); }
@keyframes bhRise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* ================= NEW vs LOST ================= */
.bh-nl { margin: 0 auto; max-width: 980px; padding: 22px; border-radius: 24px; background: #fff; border: 1px solid var(--hm-line); box-shadow: var(--hm-shadow); display: grid; gap: 14px; }
.bh-nl__legend { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; font: 600 13px/1 var(--hm-fs); color: var(--hm-muted); }
.bh-nl__legend span { display: inline-flex; align-items: center; gap: 6px; }
.bh-nl__legend i { width: 12px; height: 12px; border-radius: 3px; }
.bh-nl__legend i.up { background: var(--up); } .bh-nl__legend i.dn { background: #f0a3a3; }
.bh-nl__net { margin-left: auto; }
.bh-nl__net b { font: 800 16px/1 var(--hm-fb); color: var(--up-ink); }
.bh-nl__chart { display: grid; grid-template-columns: repeat(12, 1fr); gap: 8px; }
.bh-nl__m { display: grid; grid-template-rows: 120px 70px auto; justify-items: center; }
.bh-nl__m span { width: 64%; display: flex; }
.bh-nl__m .up { align-items: flex-end; border-bottom: 1px solid #d6dce6; }
.bh-nl__m .dn { align-items: flex-start; }
.bh-nl__m span i { width: 100%; height: var(--h); border-radius: 5px 5px 0 0; background: var(--up); }
.bh-nl__m .dn i { height: calc(var(--h) * .58); border-radius: 0 0 5px 5px; background: #f0a3a3; }
.bh-nl__m small { margin-top: 6px; font: 700 10.5px/1 var(--hm-fb); color: var(--hm-faint); }
.bh-nl figcaption { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; font-size: 13.5px; color: var(--hm-muted); }
.bh-nl.is-in .bh-nl__m .up i { animation: bhGrowUp .6s cubic-bezier(.2,.8,.2,1) both; animation-delay: calc(var(--i) * .05s); transform-origin: bottom; }
.bh-nl.is-in .bh-nl__m .dn i { animation: bhGrowUp .6s cubic-bezier(.2,.8,.2,1) both; animation-delay: calc(.3s + var(--i) * .05s); transform-origin: top; }
@keyframes bhGrowUp { from { transform: scaleY(0); } to { transform: none; } }

/* ================= LOST: alert email ================= */
.bh-mail { margin: 0; padding: 18px; border-radius: 22px; background: #fff; border: 1px solid var(--hm-line); box-shadow: var(--hm-shadow); display: grid; gap: 12px; max-width: 520px; justify-self: center; width: 100%; }
.bh-mail__h { display: grid; gap: 4px; padding-bottom: 12px; border-bottom: 1px solid var(--hm-line); }
.bh-mail__from { display: inline-flex; align-items: center; gap: 7px; font: 700 12px/1 var(--hm-fb); color: var(--hm-muted); }
.bh-mail__from i { width: 18px; height: 18px; border-radius: 5px; background: linear-gradient(135deg, #ff8b1f, #ff5d00); }
.bh-mail__h b { font: 700 16px/1.3 var(--hm-fb); }
.bh-mail__h small { font-size: 12.5px; color: var(--hm-faint); }
.bh-mail__sum { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.bh-mail__sum span { padding: 12px; border-radius: 12px; font-size: 13px; }
.bh-mail__sum b { display: block; font: 800 24px/1 var(--hm-fb); margin-bottom: 2px; }
.bh-mail__sum .up { background: var(--up-bg); color: var(--up-ink); } .bh-mail__sum .dn { background: var(--dn-bg); color: var(--dn-ink); }
.bh-mail ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.bh-mail li { display: grid; grid-template-columns: 50px 1fr auto; gap: 10px; align-items: center; padding: 9px 10px; border-radius: 10px; background: var(--hm-soft); font: 600 13px/1.2 var(--hm-fs); color: var(--hm-ink2); }
.bh-mail li span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bh-mail li em { font-style: normal; text-align: center; font: 800 10.5px/1 var(--hm-fb); padding: 5px 0; border-radius: 999px; }
.bh-mail li.dn em { background: var(--dn-bg); color: var(--dn-ink); } .bh-mail li.up em { background: var(--up-bg); color: var(--up-ink); }
.bh-mail li small { font-size: 11.5px; color: var(--hm-faint); white-space: nowrap; }
.bh-mail__cta { justify-self: start; padding: 10px 14px; border-radius: 10px; background: var(--hm-ink); color: #fff; font: 700 13px/1 var(--hm-fb); }
.bh-mail figcaption { display: flex; justify-content: space-between; font-size: 12.5px; color: var(--hm-faint); }
.bh-mail.is-in li { animation: bhRise .4s ease both; }
.bh-mail.is-in li:nth-child(2) { animation-delay: .1s; } .bh-mail.is-in li:nth-child(3) { animation-delay: .2s; }

/* ================= HOW FAR BACK (dark) ================= */
.bh-back { padding-block: var(--hm-gap); color: #fff; background: radial-gradient(60% 90% at 20% 30%, #3a2410 0%, transparent 60%), #120d0a; }
.bh-back .hm-head h2 { color: #fff; } .bh-back .hm-head p { color: #c9bfb5; } .bh-back .hm-eb { color: #ffab5c; }
.bh-era { display: grid; gap: 16px; }
.bh-era__bar { display: grid; grid-template-columns: 5fr auto 2.2fr; align-items: center; gap: 0; }
.bh-era__past, .bh-era__next { height: 54px; display: grid; place-items: center; font: 700 13.5px/1.2 var(--hm-fb); }
.bh-era__past i, .bh-era__next i { font-style: normal; }
.bh-era__past { border-radius: 14px 0 0 14px; background: linear-gradient(90deg, rgba(255,138,30,.14), rgba(255,138,30,.55)); color: #ffd9b3; }
.bh-era__next { border-radius: 0 14px 14px 0; background: repeating-linear-gradient(90deg, rgba(255,255,255,.08) 0 14px, transparent 14px 22px); color: #c9bfb5; }
.bh-era__you { position: relative; z-index: 1; display: grid; justify-items: center; gap: 2px; padding: 12px 16px; border-radius: 14px; background: #ff6a00; color: #fff; box-shadow: 0 0 0 6px rgba(255,106,0,.2), 0 12px 30px -10px rgba(255,106,0,.7); }
.bh-era__you b { font: 800 15px/1.1 var(--hm-fb); }
.bh-era__you small { font-size: 11.5px; opacity: .9; white-space: nowrap; }
.bh-era__dots { display: grid; grid-template-columns: repeat(8, 1fr); gap: 6px; }
.bh-era__dots span { display: grid; justify-items: center; gap: 6px; font: 700 12px/1 var(--hm-fb); color: #c9bfb5; }
.bh-era__dots i { width: 10px; height: 10px; border-radius: 50%; background: #ff9a3d; }
.bh-era__dots .is-now { color: #fff; } .bh-era__dots .is-now i { width: 14px; height: 14px; background: #fff; box-shadow: 0 0 0 4px rgba(255,255,255,.2); }
.bh-era__dots .is-next i { background: transparent; border: 2px dashed #8f8479; }
.bh-era.is-in .bh-era__past { animation: bhSweep 1s cubic-bezier(.2,.8,.2,1) both; transform-origin: right; }
.bh-era.is-in .bh-era__dots span { animation: bhRise .4s ease both; animation-delay: calc(var(--i) * .08s); }
@keyframes bhSweep { from { transform: scaleX(0); } to { transform: none; } }

/* ================= HOW IT WORKS ================= */
.bh-flow { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.bh-flow li { position: relative; display: grid; gap: 8px; align-content: start; padding: 22px; border-radius: 20px; background: #fff; border: 1px solid var(--hm-line); }
.bh-flow li:not(:last-child)::after { content: "→"; position: absolute; right: -14px; top: 50%; transform: translateY(-50%); z-index: 1; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--hm-ink); color: #fff; font: 800 13px/1 var(--hm-fb); }
.bh-flow__n { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; background: #fff1e4; color: var(--hm-orange-ink); font: 800 16px/1 var(--hm-fb); }
.bh-flow h3 { margin: 4px 0 0; font: 700 18px/1.3 var(--hm-fb); }
.bh-flow p { margin: 0; font-size: 14.5px; line-height: 1.55; color: var(--hm-muted); }
.bh-flow.is-in li { animation: bhRise .45s ease both; animation-delay: calc(var(--i) * .12s); }

/* ================= RELATED ================= */
.bh-rel__row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.bh-rel__card { display: grid; gap: 10px; align-content: start; padding: 24px; border-radius: 20px; background: var(--hm-soft); border: 1px solid var(--hm-line); text-decoration: none; color: inherit; transition: transform .2s, box-shadow .2s; }
.bh-rel__card:hover { transform: translateY(-3px); box-shadow: 0 18px 40px -26px rgba(11,21,38,.4); }
.bh-rel__card b { font: 700 19px/1.3 var(--hm-fb); color: var(--hm-ink); }
.bh-rel__card p { margin: 0; font-size: 15px; line-height: 1.55; color: var(--hm-muted); }
.bh-rel__go { font: 700 14.5px/1 var(--hm-fb); color: var(--hm-orange-ink); }

/* ================= PLANS ================= */
.bh-plans__box { display: grid; grid-template-columns: 1.1fr 1fr; gap: 36px; align-items: center; padding: 30px; border-radius: 24px; background: #fff; border: 1px solid var(--hm-line); }
.bh-plans__box h2 { margin: 14px 0 10px; font-size: clamp(24px, 2.8vw, 32px); }
.bh-plans__box p { margin: 0; font-size: 15.5px; line-height: 1.55; color: var(--hm-muted); }
.bh-plans__list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.bh-plans__list li { display: grid; grid-template-columns: 80px 1fr auto; gap: 12px; align-items: center; padding: 14px 16px; border-radius: 14px; background: var(--hm-soft); border: 1px solid var(--hm-line); }
.bh-plans__list li.is-pop { background: #fff4e8; border-color: #ffd29a; }
.bh-plans__list b { font: 800 16px/1 var(--hm-fb); }
.bh-plans__list span { font-size: 14px; color: var(--hm-ink2); }
.bh-plans__list em { font-style: normal; font: 700 14px/1 var(--hm-fb); color: var(--hm-muted); }
.bh-plans .hm-price-foot { margin-top: 18px; }

/* ================= smaller screens ================= */
@media (max-width: 1000px) {
  .bh-split, .bh-plans__box { grid-template-columns: 1fr; gap: 28px; }
  .bh-split--flip > :first-child { order: 0; }
  .bh-bul--row { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .bh-total__top b { font-size: 36px; }
  .bh-bio__h { display: none; }
  .bh-bio__r { grid-template-columns: 1fr auto; }
  .bh-bio__fl { grid-column: 1 / -1; grid-row: 2; grid-template-columns: 1fr 1fr; }
  .bh-st { grid-column: 2; grid-row: 1; }
  .bh-nl { padding: 14px; }
  .bh-nl__chart { gap: 3px; }
  .bh-nl__m { grid-template-rows: 90px 52px auto; }
  .bh-nl__m small { font-size: 8.5px; }
  .bh-nl__net { margin-left: 0; }
  .bh-era__bar { grid-template-columns: 1fr; gap: 8px; }
  .bh-era__past, .bh-era__next { border-radius: 14px; }
  .bh-era__dots { grid-template-columns: repeat(4, 1fr); row-gap: 14px; }
  .bh-flow, .bh-rel__row { grid-template-columns: 1fr; }
  .bh-flow li:not(:last-child)::after { right: 50%; top: auto; bottom: -15px; transform: translateX(50%) rotate(90deg); }
  .bh-plans__box { padding: 20px; }
  .bh-plans__list li { grid-template-columns: 1fr auto; } .bh-plans__list span { grid-column: 1; grid-row: 2; }
  .bh-mail li { grid-template-columns: 46px 1fr; } .bh-mail li small { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .bh *, .bh *::before, .bh *::after { animation: none !important; transition: none !important; }
}
