/* ════════════════════════════════════════════════════════════════
   ORBIT tools — /tools/ hub + tool pages (v79)
   Extends orbit.css using its tokens only; loaded on tool pages only.
   ════════════════════════════════════════════════════════════════ */

/* [hidden] must win over the display rules below */
#tphTool [hidden] { display: none !important; }

/* breadcrumbs */
.o-tl-crumbs { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; margin: 0 0 18px; font: 400 11.5px var(--fm); letter-spacing: .06em; color: var(--ink3); }
.o-tl-crumbs a { color: var(--ink2); text-decoration: none; }
.o-tl-crumbs a:hover { color: var(--mag); }
.o-tl-crumbs b { color: var(--ink); font-weight: 400; }
.o-tl-hero { padding-bottom: 20px; }

/* hub: category jump links */
.o-tl-jump { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 18px; }
.o-tl-jump a { font: 400 11px var(--fm); letter-spacing: .05em; padding: 7px 12px; border-radius: 999px; border: 1px solid var(--line); color: var(--ink2); text-decoration: none; background: var(--glass); transition: border-color .2s, color .2s, transform .2s; }
.o-tl-jump a:hover { border-color: var(--vio); color: var(--ink); transform: translateY(-1px); }

.o-tl-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 30px; }
@media (max-width: 760px) { .o-tl-stats { grid-template-columns: 1fr 1fr; } }

/* featured SEO checker */
.o-tl-feature { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 40px; align-items: center; padding: 40px; position: relative; overflow: hidden; }
.o-tl-feature::after { content: ''; position: absolute; inset: auto -120px -160px auto; width: 420px; height: 420px; border-radius: 50%; background: radial-gradient(circle, rgba(195,18,236,.22), transparent 70%); pointer-events: none; }
.o-tl-feature .o-h2 { margin: 6px 0 12px; }
.o-tl-feature .o-sub { margin: 0 0 18px; }
.o-tl-feature-term { display: flex; flex-direction: column; font-size: 12px; line-height: 1.9; white-space: pre; overflow-x: auto; }
.o-tl-feature-term .g { color: var(--ok); font-weight: 400; }
.o-tl-feature-term .a { color: var(--amber); font-weight: 400; }
.o-tl-pills { display: flex; flex-wrap: wrap; gap: 7px; margin: 0 0 24px; }
.o-tl-pills span { font: 400 11px var(--fm); padding: 6px 11px; border-radius: 8px; border: 1px solid var(--line); color: var(--ink2); background: var(--panel2); }
@media (max-width: 900px) { .o-tl-feature { grid-template-columns: 1fr; padding: 28px 22px; } }

/* category headers */
.o-tl-cat { scroll-margin-top: 90px; }
#cat-seo { scroll-margin-top: 90px; }
.o-tl-cat-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin: 40px 0 26px; }
.o-tl-cat-head .o-h2 { margin: 6px 0 8px; }
.o-tl-cat-head .o-sub { margin: 0; max-width: 640px; }
.o-tl-h2-sub { display: block; font-size: .62em; font-weight: 600; margin-top: 4px; color: var(--ink2); }
.o-tl-count { font: 400 11px var(--fm); letter-spacing: .12em; text-transform: uppercase; color: var(--mag); white-space: nowrap; padding-bottom: 6px; }

/* tool cards */
.o-tl-cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 1100px) { .o-tl-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 820px) { .o-tl-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px) { .o-tl-cards { grid-template-columns: 1fr; } }
.o-tl-card { display: flex; flex-direction: column; gap: 10px; padding: 22px; min-height: 196px; text-decoration: none; color: var(--ink); position: relative; overflow: hidden; transition: transform .35s var(--ease), border-color .3s, box-shadow .35s; }
.o-tl-card::before { content: ''; position: absolute; inset: 0; border-radius: inherit; background: radial-gradient(380px 220px at 50% 0%, rgba(123,33,255,.14), transparent 70%); opacity: 0; transition: opacity .35s; pointer-events: none; }
.o-tl-card:hover, .o-tl-card:focus-visible { transform: translateY(-3px); border-color: rgba(139,92,246,.45); box-shadow: var(--glow), var(--shadow); outline: none; }
.o-tl-card:hover::before { opacity: 1; }
.o-tl-card-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.o-tl-ico svg { width: 18px; height: 18px; }
.o-tl-card b { font: 700 16px var(--fd); }
.o-tl-card .d { font-size: 13.5px; line-height: 1.6; color: var(--ink2); flex: 1; }
.o-tl-card .go { font: 400 11.5px var(--fm); color: var(--mag); letter-spacing: .04em; }
.o-tl-card:hover .go span { display: inline-block; transform: translateX(3px); transition: transform .2s; }
.o-tl-tag { font: 400 10px var(--fm); text-transform: uppercase; letter-spacing: .1em; padding: 4px 9px; border-radius: 7px; color: var(--mag); border: 1px solid color-mix(in srgb, var(--mag) 40%, transparent); background: color-mix(in srgb, var(--mag) 10%, transparent); }
.o-tl-tag.ext { color: var(--vio); border-color: color-mix(in srgb, var(--vio) 40%, transparent); background: color-mix(in srgb, var(--vio) 10%, transparent); }
.o-tl-card.is-hidden, .o-tl-cat.is-hidden, .o-tl-feature.is-hidden { display: none; }

/* lookup extra options under the command bar */
.o-tl-opts { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 12px; }
.o-tl-opt { display: inline-flex; align-items: center; gap: 8px; font: 400 11px var(--fm); letter-spacing: .08em; text-transform: uppercase; color: var(--ink3); }
.o-tl-opt .o-vpc-select { width: auto; min-width: 120px; padding: 9px 12px; font-size: 13px; }
.o-tl-opt input.o-vpc-select { width: 140px; }

/* generic result rendering */
.o-tl-verdict { display: flex; align-items: center; gap: 12px; padding: 18px 22px; margin-bottom: 16px; font: 600 15px var(--fd); }
.o-tl-verdict i { width: 10px; height: 10px; border-radius: 50%; flex: none; background: var(--ink3); }
.o-tl-verdict.ok i { background: var(--ok); box-shadow: 0 0 12px var(--ok); }
.o-tl-verdict.warn i { background: var(--amber); box-shadow: 0 0 12px var(--amber); }
.o-tl-verdict.bad i { background: var(--red); box-shadow: 0 0 12px var(--red); }
.o-tl-verdict small { display: block; font: 400 12px var(--fm); color: var(--ink3); margin-top: 3px; word-break: break-all; }
.o-tl-sum { display: grid; grid-template-columns: repeat(auto-fit, minmax(118px, 1fr)); gap: 12px; margin-bottom: 16px; }
.o-tl-sum .o-bl-stat b { font-size: 20px; word-break: break-word; }
.o-tl-sum .o-bl-stat.ok b { color: var(--ok); }
.o-tl-sum .o-bl-stat.warn b { color: var(--amber); }
.o-tl-sum .o-bl-stat.bad b { color: var(--red); }
.o-tl-table { padding: 24px; margin-bottom: 16px; }
.o-tl-table h3 { margin: 0 0 12px; font: 700 15px var(--fd); color: var(--ink); }
.o-tl-table td { overflow-wrap: anywhere; word-break: normal; font-family: var(--fm); font-size: 12.5px; }
.o-tl-table td:first-child, .o-tl-table td.nw { white-space: nowrap; overflow-wrap: normal; }
.o-tl-table td:first-child { color: var(--ink); }
.o-tl-table .o-tl-wide { min-width: 620px; }
@media (max-width: 640px) {
  .o-tl-table { padding: 18px 14px; }
  .o-tl-sum { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .o-tl-sum .o-bl-stat { padding: 14px 8px; }
  .o-tl-sum .o-bl-stat b { font-size: 16px; }
  .o-tl-sum .o-bl-stat .k { font-size: 9.5px; letter-spacing: .08em; }
}

/* hash table: fixed label + button columns, hash takes the rest */
.o-tl-hash td { vertical-align: middle; }
.o-tl-hash td:first-child { white-space: nowrap; width: 1%; color: var(--ink); font: 600 12px var(--fm); }
.o-tl-hash td:nth-child(2) { overflow-wrap: anywhere; word-break: normal; }
.o-tl-hash td:last-child { width: 1%; }
.o-tl-hash .o-btn, .o-tl-actions .o-btn, .o-tl-list li button { white-space: nowrap; }
@media (max-width: 640px) {
  .o-tl-hash tr { display: grid; grid-template-columns: 1fr auto; grid-template-areas: "k b" "v v"; gap: 6px 10px; padding: 12px 0; border-bottom: 1px solid var(--line2); }
  .o-tl-hash td { display: block; border: 0; padding: 0; width: auto !important; }
  .o-tl-hash td:first-child { grid-area: k; align-self: center; }
  .o-tl-hash td:nth-child(2) { grid-area: v; font-size: 12px; }
  .o-tl-hash td:last-child { grid-area: b; }
}
.o-tl-notes { margin: 0 0 16px; padding: 16px 20px; list-style: none; font-size: 14px; color: var(--ink2); }
.o-tl-notes li + li { margin-top: 8px; }
.o-tl-raw { font-size: 12px; white-space: pre-wrap; word-break: break-all; max-height: 320px; overflow: auto; margin-bottom: 16px; }

/* client tools layout */
.o-tl-box { padding: 26px; }
.o-tl-2col { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.o-tl-2col > .o-tl-res { position: sticky; top: 90px; }
@media (max-width: 900px) { .o-tl-2col { grid-template-columns: 1fr; } .o-tl-2col > .o-tl-res { position: static; } }
.o-tl-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.o-tl-grid.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 760px) { .o-tl-grid, .o-tl-grid.g4 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 460px) { .o-tl-grid, .o-tl-grid.g4 { grid-template-columns: 1fr; } }
.o-tl-grid .o-btn { width: 100%; }
.o-tl-split { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 16px; }
@media (max-width: 760px) { .o-tl-split { grid-template-columns: 1fr; } }
.o-tl-code { width: 100%; min-height: 170px; font: 400 12.5px/1.7 var(--fm) !important; padding: 14px 16px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel2); color: var(--ink); resize: vertical; margin-top: 14px; box-sizing: border-box; }
.o-field .o-tl-code { margin-top: 0; }
.o-tl-code.tall { min-height: 340px; }
.o-tl-code:focus { outline: none; border-color: var(--vio); box-shadow: 0 0 0 4px rgba(139,92,246,.16); }
.o-tl-pre { margin: 0; min-height: 120px; max-height: 360px; overflow: auto; white-space: pre-wrap; word-break: break-all; }
.o-tl-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 14px; }
.o-tl-meta { font: 400 11.5px var(--fm); color: var(--ink3); margin-left: auto; }
.o-tl-checks { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.o-tl-checks.col { flex-direction: column; gap: 8px; margin: 18px 0; }
.o-tl-file input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.o-tl-file span { cursor: pointer; }
.o-tl-result-head, .o-tl-big { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.o-tl-result-head .k, .o-tl-big .k { font: 400 11px var(--fm); letter-spacing: .14em; text-transform: uppercase; color: var(--ink3); }
.o-tl-result-head b { font: 700 16px var(--fd); }
.o-tl-big { flex-direction: column; align-items: flex-start; gap: 4px; }
.o-tl-big b { font: 800 clamp(30px, 4.4vw, 44px)/1.1 var(--fd); background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; word-break: break-word; }
.o-tl-big small { font-size: 13.5px; color: var(--ink2); }
.o-tl-meter { height: 7px; border-radius: 999px; background: var(--panel2); overflow: hidden; margin: 12px 0 16px; }
.o-tl-meter i { display: block; height: 100%; width: 0; background: var(--grad); transition: width .35s var(--ease), background .3s; }
.o-tl-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.o-tl-list li { font: 400 13.5px var(--fm); padding: 10px 12px; border-radius: 10px; background: var(--panel2); border: 1px solid var(--line2); word-break: break-all; display: flex; justify-content: space-between; align-items: center; gap: 10px; color: var(--ink); }
.o-tl-list li button { flex: none; font: 400 10.5px var(--fm); text-transform: uppercase; letter-spacing: .08em; border: 1px solid var(--line); background: transparent; color: var(--ink2); padding: 5px 9px; border-radius: 7px; cursor: pointer; }
.o-tl-list li button:hover { color: var(--mag); border-color: var(--mag); }
ol.o-tl-list { counter-reset: n; }
.o-tl-say { font-size: 15px; line-height: 1.7; color: var(--ink2); margin: 14px 0 0; }
.o-tl-say b { color: var(--ink); }
.o-tl-say.ok b { color: var(--ok); } .o-tl-say.bad b { color: var(--red); } .o-tl-say.warn b { color: var(--amber); }
.o-tl-h3 { font: 700 16px var(--fd); margin: 24px 0 12px; color: var(--ink); }
.o-tl-h3 small { font: 400 11px var(--fm); color: var(--ink3); }
.o-tl-kv { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 10px; margin-top: 18px; }
.o-tl-kv div { padding: 14px 16px; border-radius: 12px; background: var(--panel2); border: 1px solid var(--line2); }
.o-tl-kv span { display: block; font: 400 10.5px var(--fm); letter-spacing: .12em; text-transform: uppercase; color: var(--ink3); margin-bottom: 6px; }
.o-tl-kv b { font: 600 15px var(--fm); color: var(--ink); word-break: break-all; }

/* cron */
.o-tl-cron { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; margin-top: 16px; }
.o-tl-cron input { text-align: center; font-family: var(--fm) !important; }
@media (max-width: 640px) { .o-tl-cron { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.o-tl-cronline { display: flex; align-items: center; gap: 10px; margin-top: 16px; padding: 12px 14px; border-radius: 12px; background: var(--panel2); border: 1px solid var(--line); }
.o-tl-cronline code { flex: 1; font: 700 15px var(--fm); color: var(--mag); word-break: break-all; }

/* contrast */
.o-tl-color { display: flex; gap: 8px; }
.o-tl-color input[type=color] { width: 52px; min-width: 52px; height: 48px; padding: 4px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel2); cursor: pointer; }
.o-tl-color input[type=text] { flex: 1; min-width: 0; font-family: var(--fm) !important; text-transform: uppercase; }
.o-tl-preview { margin-top: 18px; padding: 24px; border-radius: 14px; border: 1px solid var(--line); }
.o-tl-preview b { display: block; font: 700 24px var(--fd); margin-bottom: 8px; }
.o-tl-preview p { margin: 0 0 14px; font-size: 16px; line-height: 1.6; }
.o-tl-preview .btnp { display: inline-block; padding: 9px 16px; border-radius: 9px; border: 2px solid currentColor; font: 600 14px var(--fd); }

/* what is my ip */
.o-tl-myip { padding: 30px; text-align: center; }
.o-tl-myip .k { font: 400 11px var(--fm); letter-spacing: .14em; text-transform: uppercase; color: var(--ink3); }
.o-tl-myip b { display: block; font: 800 clamp(26px, 5vw, 46px)/1.15 var(--fm); margin: 10px 0 6px; word-break: break-all; }

.o-tl-privacy { display: flex; align-items: center; justify-content: center; gap: 9px; margin: 18px 0 0; font: 400 11.5px var(--fm); color: var(--ink3); letter-spacing: .04em; }

/* small "plan match" card inside calculators */
.o-tl-plan { margin-top: 18px; padding: 18px; border-radius: 14px; border: 1px solid color-mix(in srgb, var(--mag) 35%, var(--line)); background: color-mix(in srgb, var(--mag) 6%, var(--panel2)); }
.o-tl-plan .k { font: 400 10.5px var(--fm); letter-spacing: .12em; text-transform: uppercase; color: var(--mag); }
.o-tl-plan h4 { margin: 6px 0 4px; font: 700 17px var(--fd); color: var(--ink); }
.o-tl-plan p { margin: 0 0 12px; font-size: 13.5px; color: var(--ink2); }
.o-tl-bar { display: flex; height: 26px; border-radius: 9px; overflow: hidden; margin-top: 16px; border: 1px solid var(--line); }
.o-tl-bar i { display: flex; align-items: center; justify-content: center; font: 400 10.5px var(--fm); color: #fff; font-style: normal; white-space: nowrap; overflow: hidden; }
.o-tl-bar i.u { background: var(--grad); } .o-tl-bar i.p { background: var(--panel2); color: var(--ink3); }

html[data-theme="light"] .o-tl-feature-term .g { color: #12a46a; }
html[data-theme="light"] .o-tl-jump a { background: #fff; }

/* ── WCAG 2.2 AA contrast on tool pages ──────────────────────────
   orbit.css muted text (--ink3) and magenta labels measure 3.2–4.4 : 1.
   Same hues, nudged to ≥ 4.5 : 1. Kept last + body-scoped so it wins. */
:root, body[data-tph-themed] { --ink3: #7C82A6; }
html[data-theme="light"], html[data-theme="light"] body[data-tph-themed] { --ink3: #6B6785; }
body[data-tph-themed] .o-row .term, body[data-tph-themed] .o-tl-count, body[data-tph-themed] .o-tl-plan .k,
body[data-tph-themed] .o-tl-cronline code, body[data-tph-themed] .o-tl-card .go, body[data-tph-themed] .o-tl-tag { color: #D24DF4; }
html[data-theme="light"] body[data-tph-themed] .o-row .term, html[data-theme="light"] body[data-tph-themed] .o-tl-count,
html[data-theme="light"] body[data-tph-themed] .o-tl-plan .k, html[data-theme="light"] body[data-tph-themed] .o-tl-cronline code,
html[data-theme="light"] body[data-tph-themed] .o-tl-card .go, html[data-theme="light"] body[data-tph-themed] .o-tl-tag { color: #A80ECC; }
html[data-theme="light"] body[data-tph-themed] .o-kick em { color: #6D3FD9; }
html[data-theme="light"] body[data-tph-themed] .o-foot-status { color: #0E7C50; }
body[data-tph-themed] .o-tl-say a { color: #A48AF9 !important; }
html[data-theme="light"] body[data-tph-themed] .o-tl-say a { color: #6D3FD9 !important; }
/* light theme: status colours darkened so results stay ≥ 4.5 : 1 on white panels */
html[data-theme="light"] body[data-tph-themed] { --ok: #0E7C50; --amber: #9A5B00; --red: #C8243F; }
html[data-theme="light"] body[data-tph-themed] .o-bl-stat.ok b, html[data-theme="light"] body[data-tph-themed] .o-mega-term .ok { color: #0E7C50; }
html[data-theme="light"] body[data-tph-themed] .o-bl-stat.bad b { color: #C8243F; }
body[data-tph-themed] .o-cmd .pre { color: #D24DF4; }
html[data-theme="light"] body[data-tph-themed] .o-cmd .pre { color: #A80ECC; }
