/* Tool pages (/tool/{slug}, views/modules/tools/page.blade.php): hero badges, the tool lifted over the hero at full
   width, then "On this page" | article | sidebar, and a closing band. Article markup (Custom HTML page, editable):
   .tp-tool > .tp-bar + [shortcode];  .tp-body > section > .tp-eyebrow, h2, .tp-sub, .tp-cards|.tp-grid > .tp-card
   (> .tp-ic, h3, p), ol.tp-steps > li (> h3, p), .tp-table > table, ul.tp-list, .tp-chips (> strong, span), details (> summary, p);  .tp-end > .tp-end-ic (an emoji, shown as a line icon), div (> h2, p), a.mm-btn. */
.tp-badges { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 16px; padding: 0; list-style: none; }
.tp-badges li { padding: 6px 12px; border: 1px solid rgba(255, 255, 255, .18); border-radius: 999px; background: rgba(255, 255, 255, .08); color: #FFF; font-size: 13px; font-weight: 600; }
.tp-badges li::before { content: "✓ "; color: var(--mm-gold); }
.tp-hl { color: var(--mm-gold); }
.tp .mm-phero-in { padding-bottom: 176px; }

.tp-page { display: grid; grid-template-columns: 200px minmax(0, 1fr) 300px; column-gap: 48px; max-width: var(--mm-wide); margin: 0 auto; padding: 0 20px; }
.tp-tool { grid-column: 1 / -1; grid-row: 1; position: relative; z-index: 2; margin-top: -144px; padding: 0 32px 32px; border-radius: 28px; background: #FFF; box-shadow: 0 40px 80px -40px rgba(35, 28, 90, .45); scroll-margin-top: 112px; }
.tp-bar { max-width: none; margin: 0 -32px 32px; padding: 16px 32px; border-bottom: 1px solid var(--mm-line); border-radius: 28px 28px 0 0; background: var(--mm-lilac); color: var(--mm-ink); font-size: 14px; font-weight: 600; }
/* The theme caps form fields (and prose) for forms on content pages; a tool's own CSS decides its widths. :where()
   keeps this at one class of weight, so any width a snippet sets for itself still wins. */
.tp-tool :where(input, select, textarea, p, ul, ol) { max-width: none; }
.tp-tool :where(label, button) { margin-top: 0; }
.tp-tool :where(button):hover { transform: none; }
.tp-left { grid-column: 1; grid-row: 2; }
.tp-body { grid-column: 2; grid-row: 2; min-width: 0; }
.tp-aside { grid-column: 3; grid-row: 2; display: grid; gap: 20px; min-width: 0; }
.tp-left, .tp-aside { position: sticky; top: 112px; align-self: start; margin-top: 64px; }

.tp-toc-h, .tp-eyebrow { margin: 0 0 8px; color: var(--mm-link); font-size: 13px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; }
.tp-toc a { display: block; margin-left: -12px; padding: 8px 0 8px 12px; border-left: 3px solid transparent; color: var(--mm-muted); font-size: 15px; text-decoration: none; }
.tp-toc a:hover, .tp-toc a[aria-current] { color: var(--mm-ink); }
.tp-toc a[aria-current] { border-left-color: var(--mm-gold); font-weight: 600; }
.tp-left .mm-share { margin-top: 24px; }
.tp-left--plain { position: static; padding-top: 0; padding-bottom: 64px; }
.tp-left--plain .mm-share { margin-top: 0; }
.tp-left .mm-ps-h { margin: 0 0 8px; color: var(--mm-link); font-size: 13px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; }
.mm-share-row { display: flex; flex-wrap: wrap; gap: 8px; }
.mm-share-row .bookmark { margin: 0; }
.tp-left .mm-share-a { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; margin: 0; padding: 0; border: 1.5px solid var(--mm-line); border-radius: 50%; background: #FFF; color: var(--mm-ink); text-decoration: none; }
.tp-left .mm-share-a:hover, .tp-left .mm-share-a[aria-pressed="true"] { border-color: var(--mm-ink); background: var(--mm-ink); color: #FFF; box-shadow: none; transform: none; }
.tp-left .mm-share-b span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.tp-body > section { padding: 64px 0; scroll-margin-top: 112px; }
.tp-body > section + section { border-top: 1px solid var(--mm-line); }
.tp-body h2 { margin: 0 0 12px; }
.tp-body h3 { margin: 0 0 6px; font-size: 18px; }
.tp-body p { margin: 0; color: var(--mm-muted); line-height: 1.6; }
.tp-body .tp-sub { max-width: 68ch; margin-bottom: 32px; }
.tp-cards, .tp-grid { display: grid; gap: 16px; }
.tp-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.tp-card { padding: 24px; border: 1px solid var(--mm-line); border-radius: 20px; background: #FFF; }
.tp-cards .tp-card { display: grid; grid-template-columns: 52px 1fr; column-gap: 16px; }
.tp-cards .tp-ic { grid-row: span 2; }
.tp-ic { display: grid; place-items: center; width: 52px; height: 52px; margin-bottom: 16px; border-radius: 14px; background: var(--tp-ic-bg, var(--mm-lilac)); color: var(--tp-ic-fg, var(--mm-link)); }
.tp-ic svg { width: 26px; height: 26px; }
.mm-ico--i { width: 1.15em; height: 1.15em; margin-right: .15em; color: var(--tp-ic-fg, var(--mm-link)); vertical-align: -.2em; }
.tp-cards .tp-ic { margin: 0; }
.tp-steps { display: grid; gap: 24px; margin: 24px 0 0; padding: 0; list-style: none; counter-reset: tp; }
.tp-steps li { display: grid; grid-template-columns: 44px 1fr; column-gap: 16px; counter-increment: tp; }
.tp-steps li::before { content: counter(tp); grid-row: span 2; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: var(--mm-ink); color: var(--mm-gold); font-weight: 600; }
.tp-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 32px !important; }
.tp-chips strong { margin-right: 4px; color: var(--mm-ink); }
.tp-chips span { padding: 8px 14px; border: 1px solid var(--mm-line); border-radius: 999px; color: var(--mm-ink); font-size: 14px; }
.tp-table { margin: 24px 0 0; overflow-x: auto; border: 1px solid var(--mm-line); border-radius: 16px; }
.tp-table table { width: 100%; min-width: 520px; border-collapse: collapse; font-size: 15px; }
.tp-table th, .tp-table td { padding: 12px 16px; border-bottom: 1px solid var(--mm-line); text-align: left; vertical-align: top; }
.tp-table th { background: var(--mm-surface); color: var(--mm-ink); font-weight: 600; }
.tp-table tr:last-child td { border-bottom: 0; }
.tp-body ul.tp-list { margin: 16px 0 0; padding-left: 20px; color: var(--mm-muted); line-height: 1.6; }
.tp-body ul.tp-list li + li { margin-top: 8px; }
.tp-body details { margin-top: 12px; padding: 18px 22px; border: 1px solid var(--mm-line); border-radius: 16px; }
.tp-body summary { min-height: 24px; color: var(--mm-ink); font-weight: 600; cursor: pointer; }
.tp-body details p { margin-top: 10px; }

.tp-box { min-width: 0; padding: 24px; border-radius: 24px; background: var(--mm-surface); }
.tp-box-h { margin: 0 0 8px; color: var(--mm-ink); font-size: 18px; font-weight: 600; }
.tp-rel, .tp-all { display: block; padding: 12px 0; border-top: 1px solid var(--mm-line); color: var(--mm-ink); font-weight: 600; text-decoration: none; }
.tp-rel span { display: block; overflow: hidden; color: var(--mm-muted); font-size: 14px; font-weight: 400; text-overflow: ellipsis; white-space: nowrap; }
.tp-all { color: var(--mm-link); }
.tp-box--ink { background: var(--mm-ink); }
.tp-box--ink .tp-box-h { color: #FFF; }
.tp-box--ink p { margin: 0 0 16px; color: var(--mm-on-ink); }

.tp-after { max-width: var(--mm-wide); margin: 0 auto; padding: 16px 20px 80px; }
.tp-end { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 24px; padding: 32px 40px; border: 1px solid var(--mm-line); border-radius: 28px; background: var(--mm-surface); }
.tp-end-ic { display: grid; place-items: center; width: 72px; height: 72px; border: 1px solid var(--mm-line); border-radius: 20px; background: #FFF; color: var(--tp-ic-fg, var(--mm-link)); }
.tp-end-ic svg { width: 34px; height: 34px; }
.tp-end h2 { margin: 0 0 6px; font-size: 25px; }
.tp-end p { margin: 0; color: var(--mm-muted); }

/* Ratings (Modules/Tools/resources/views/partials/rating.blade.php): stars, average, the strip under the tool, the card. */
.tp-stars { display: flex; margin: 0 -6px; }
.tp-star { display: inline-grid; place-items: center; width: 44px; height: 44px; margin: 0; padding: 0; border: 0; background: none; box-shadow: none; cursor: pointer; }
.tp-star svg { fill: none; stroke: #C9C2F0; stroke-width: 1.6; stroke-linejoin: round; transition: transform 150ms; }
.tp-star.is-on svg, .tp-stars:hover .tp-star svg { fill: var(--mm-gold); stroke: #E5A91A; }
.tp-stars:hover .tp-star:hover ~ .tp-star svg { fill: none; stroke: #C9C2F0; }
.tp-star:hover svg { transform: scale(1.12); }
.tp-star:focus-visible { outline: 2px solid var(--mm-link); outline-offset: -4px; border-radius: 50%; }
.tp-rsum { display: inline-flex; align-items: center; gap: 8px; color: var(--mm-muted); font-size: 14px; }
.tp-rsum[hidden] { display: none; }
.tp-rsum b { color: var(--mm-ink); font-size: 16px; }
.tp-rbar { position: relative; font-size: 16px; line-height: 1; letter-spacing: 1px; color: #DDD8F5; }
.tp-rbar::before, .tp-rbar::after { content: "★★★★★"; }
.tp-rbar::after { position: absolute; top: 0; left: 0; width: var(--r); overflow: hidden; color: var(--mm-gold); white-space: nowrap; }
.tp-hero-rate { margin: 16px 0 0; }
.tp-hero-rate .tp-rsum { color: var(--mm-on-ink); }
.tp-hero-rate .tp-rsum b { color: #FFF; }
.tp-hero-rate .tp-rbar { color: rgba(255, 255, 255, .25); }
.tp-hero-rate:not(:has(.tp-rsum:not([hidden]))) { display: none; }
/* Use counts (audit A2, owner's pick B + D): a live line under the hero, and "Used N times here" by the rating strip. */
.tp-used { display: flex; align-items: center; gap: 10px; margin: 16px 0 0; color: var(--mm-on-ink); font-size: 14px; font-weight: 600; }
.tp-used b { color: #FFF; }
.tp-used-dot { flex: none; width: 8px; height: 8px; border-radius: 50%; background: #34D399; box-shadow: 0 0 0 4px rgba(52, 211, 153, .22); }
.tp-used-here { margin: 0; color: var(--mm-muted); font-size: 14px; font-weight: 600; }
.tp-used-here::before { content: "\2713\00a0"; color: #0B7352; }
.tp-rate { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 24px; margin: 32px -32px -32px; padding: 12px 32px; border-top: 1px solid var(--mm-line); border-radius: 0 0 28px 28px; background: var(--mm-surface); }
.tp-rate-l { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 16px; }
.tp-rate-h { margin: 0; color: var(--mm-ink); font-weight: 600; }
.tp-rate-msg { flex-basis: 100%; margin: 0; color: var(--mm-muted); font-size: 14px; }
.tp-rate-msg:empty { display: none; }
.tp-rate-more { flex-basis: 100%; display: grid; gap: 8px; margin: 4px 0 8px; }
.tp-rate-more[hidden] { display: none; }
.tp-rate-more label { margin: 0; }
.tp-rate-more textarea { min-height: 72px; padding: 12px 14px; font-size: 16px; }
.tp-rate-send { justify-self: start; min-height: 44px; padding: 0 20px; border: 1.5px solid var(--mm-line); border-radius: 12px; background: #FFF; color: var(--mm-ink); }
.tp-body > .tp-rcard { margin: 16px 0 64px; padding: 32px; border: 1px solid var(--mm-line); border-radius: 24px; }
.tp-rcard-p { margin: 4px 0 12px !important; font-size: 14px; }
.tp-rcard .tp-rate-msg { margin-top: 8px; }
.tp-rcard-sum { display: flex; flex-wrap: wrap; align-items: center; gap: 24px 40px; margin-top: 24px; padding-top: 24px; border-top: 1px solid var(--mm-line); }
.tp-rcard-big { margin: 0 0 4px !important; color: var(--mm-ink) !important; font: 600 48px/1 var(--mm-font-display); }
.tp-rdist { display: grid; flex: 1 1 240px; gap: 6px; }
.tp-rdist-r { display: grid; grid-template-columns: 28px 1fr 40px; align-items: center; gap: 8px; color: var(--mm-muted); font-size: 13px; }
.tp-rdist-r i { display: block; height: 8px; overflow: hidden; border-radius: 99px; background: var(--mm-lilac); }
.tp-rdist-r b { display: block; height: 100%; background: var(--mm-gold); }

@media (max-width: 1279.98px) {
    .tp-page { grid-template-columns: 180px minmax(0, 1fr); }
    .tp-aside { grid-column: 2; grid-row: 3; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); position: static; margin: 0 0 64px; }
}
@media (max-width: 1023.98px) {
    .tp-page { grid-template-columns: minmax(0, 1fr); }
    .tp-left { grid-column: 1; grid-row: 3; position: static; margin: 0 0 40px; }
    .tp-toc { display: none; }
    .tp-left .mm-share { margin-top: 0; }
    .tp-body, .tp-aside { grid-column: 1; }
    .tp-aside { grid-row: 4; }
}
@media (max-width: 767.98px) {
    .tp .mm-phero-in { padding-bottom: 120px; }
    .tp-page { padding: 0 12px; }
    .tp-tool { margin-top: -88px; padding: 0 16px 20px; border-radius: 20px; }
    .tp-bar { margin: 0 -16px 16px; padding: 12px 16px; border-radius: 20px 20px 0 0; font-size: 13px; }
    .tp-rate { margin: 24px -16px -20px; padding: 12px 16px; border-radius: 0 0 20px 20px; }
    .tp-body > .tp-rcard { padding: 24px 20px; }
    .tp-body > section { padding: 48px 4px; }
    .tp-grid { grid-template-columns: minmax(0, 1fr); }
    .tp-after { padding: 8px 12px 56px; }
    .tp-end { grid-template-columns: minmax(0, 1fr); justify-items: center; padding: 28px 20px; text-align: center; }
}
