/* ============================================================
   Track Shipment (Page 479): the inline error and the "Online tracking
   is not available yet" panel, ported from live wyvernfreight.com/track/
   (.tk-err, .tk-dlg*, .btn-p), read 2026-11-02. The search field and
   button keep the theme's .wf-track-tool styles. Live's tokens are mapped
   to the theme's below. Loaded only where the form is (functions.php).
   BLUEPRINT-TRACK.md, ARC-0085.
   ============================================================ */
:is(.wf-track-tool, .tk-dlg) {
	--hover: var(--wp--preset--color--surface-2);
	--ink: var(--wp--preset--color--ink);
	--ink-2: var(--wp--preset--color--ink-2);
	--muted: var(--wp--preset--color--muted);
	--subtle: #6b7380;
	--red: var(--wp--preset--color--red);
	--red-press: var(--wp--preset--color--red-press);
	--red-active: var(--wp--preset--color--red-active);
	--focus: var(--wp--custom--focus);
	--sans: var(--wp--preset--font-family--sans);
	--mono: var(--wp--preset--font-family--mono);
	--shadow-overlay: 0 24px 48px rgba(11, 14, 18, .24), 0 2px 4px rgba(11, 14, 18, .08);
}

/* ---------- field placeholder and error (live .tk-row input::placeholder, .tk-row[data-invalid], .tk-err) ---------- */
.wf-track-tool input[type="text"]::placeholder { font: 400 16px/1 var(--sans); letter-spacing: 0; color: var(--subtle); opacity: 1; }
.wf-track-tool form[data-invalid] input[type="text"] { border-color: var(--red); }
.wf-track-tool .tk-err { margin: 10px 0 0 !important; max-width: 760px; font: 500 15px/1.5 var(--sans) !important; color: var(--red) !important; }
.wf-track-tool .tk-err b { font-weight: 600; font-family: var(--mono); letter-spacing: .02em; }
.wf-track-tool .tk-err a { color: inherit; text-decoration: underline; text-underline-offset: 3px; }
.wf-track-tool .tk-err:empty { display: none; }

/* ---------- panel (live .tk-dlg) ---------- */
.tk-dlg { box-sizing: border-box; width: min(540px, 100vw - 32px); max-width: none; padding: 0; border: 0; background: transparent; color: var(--ink); overflow: visible; }
.tk-dlg *, .tk-dlg *::before, .tk-dlg *::after { box-sizing: border-box; }
.tk-dlg::backdrop { background: rgba(11, 14, 18, .6); }
.tk-dlg :where(h2, p) { margin: 0; }
.tk-dlg-in { position: relative; margin: 0; padding: 30px 32px; background: #fff; box-shadow: var(--shadow-overlay); }
.tk-dlg-lbl { font: 500 12px/1 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--subtle); }
.tk-dlg-ref { margin-top: 10px !important; padding-right: 44px; font: 500 clamp(28px, 4.4vw, 40px)/1.05 var(--mono); letter-spacing: .02em; color: var(--ink); overflow-wrap: anywhere; }
.tk-dlg-route { display: flex; align-items: center; margin: 24px 0 20px; }
.tk-dlg-route .n { flex: 0 0 auto; width: 9px; height: 9px; border-radius: 50%; background: var(--ink); }
.tk-dlg-route .l { flex: 1 1 0%; height: 0; margin: 0 6px; border-top: 1.5px dashed #9aa2ad; transform-origin: left center; }
.tk-dlg-route .d { flex: 0 0 auto; width: 11px; height: 11px; margin-right: 3px; background: var(--red); transform: rotate(45deg); }
.tk-dlg h2 { font: 500 24px/1.2 var(--sans); letter-spacing: -.02em; color: var(--ink); }
.tk-dlg h2:focus { outline: none; }
.tk-dlg h2 + p { margin-top: 10px; font: 400 16px/1.55 var(--sans); color: var(--muted); }
.tk-dlg-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 12px; margin-top: 26px; }
.tk-dlg-x { position: absolute; top: 22px; right: 30px; display: grid; place-items: center; width: 36px; height: 36px; padding: 0; border: 0; border-radius: 0; background: none; color: var(--ink-2); cursor: pointer; }
.tk-dlg-x:hover { background: var(--hover); color: var(--ink); }
.tk-dlg-x:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
html:has(.tk-dlg[open]) { overflow: hidden; }
/* The panel sits inside .wf-track-tool, whose search rules (form grid, form > p, red 60px buttons) must not reach it. */
.wf-track-tool .tk-dlg .tk-dlg-in { display: block; margin: 0 !important; }
.wf-track-tool .tk-dlg .tk-dlg-in > p { display: block; }
.wf-track-tool .tk-dlg button { min-height: 0; letter-spacing: normal; }
.wf-track-tool .tk-dlg .tk-dlg-x { width: 36px; padding: 0; background: none; color: var(--ink-2); } /* the search's phone rule makes buttons full width */
.wf-track-tool .tk-dlg .tk-dlg-x:hover { background: var(--hover); color: var(--ink); }
.wf-track-tool .tk-dlg .btn-p { padding: 0 24px; letter-spacing: .06em; }
/* WordPress layout margins would pin the panel to the top; the browser centres a modal dialog with margin: auto. */
.wf-track-tool .tk-dlg { margin: auto !important; }
/* The theme's paragraph type would override the panel's: restate live's values at higher specificity. */
.wf-track-tool .tk-dlg p.tk-dlg-lbl { font: 500 12px/1 var(--mono) !important; letter-spacing: .1em; text-transform: uppercase; color: var(--subtle) !important; }
.wf-track-tool .tk-dlg p.tk-dlg-ref { margin-top: 10px !important; font: 500 clamp(28px, 4.4vw, 40px)/1.05 var(--mono) !important; letter-spacing: .02em; color: var(--ink) !important; }
.wf-track-tool .tk-dlg h2 + p { max-width: 440px; margin-top: 10px !important; font: 400 16px/1.55 var(--sans) !important; color: var(--ink-2) !important; }

/* Panel buttons (live .btn-p / .btn-p.ink) */
.tk-dlg .btn-p { position: relative; display: inline-flex; align-items: center; justify-content: center; height: 44px; padding: 0 24px; border: 0; border-radius: 0; cursor: pointer; background: var(--red); color: #fff; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .18), inset 0 -1px 0 rgba(0, 0, 0, .12); font: 500 14px/1 var(--sans); letter-spacing: .06em; text-transform: uppercase; text-decoration: none; white-space: nowrap; transition: background .2s cubic-bezier(.32, .72, 0, 1), transform .18s cubic-bezier(.32, .72, 0, 1); }
.tk-dlg .btn-p:hover { background: var(--red-press); }
.tk-dlg .btn-p:active { background: var(--red-active); transform: scale(.98); }
.tk-dlg .btn-p:focus-visible { outline: none; box-shadow: inset 0 0 0 2px var(--ink), inset 0 0 0 4px #fff; }
.tk-dlg .btn-p.ink { background: var(--ink); }
.tk-dlg .btn-p.ink:hover, .tk-dlg .btn-p.ink:active { background: #000; }
.tk-dlg-alt { -webkit-appearance: none; appearance: none; }

@media (prefers-reduced-motion: no-preference) {
	.tk-dlg[open] { animation: tkDlgIn .45s cubic-bezier(.32, .72, 0, 1); }
	.tk-dlg[open]::backdrop { animation: tkFade .3s ease-out; }
	.tk-dlg[open] .tk-dlg-route .l { animation: tkRun .6s cubic-bezier(.32, .72, 0, 1) .18s both; }
	.tk-dlg[open] .tk-dlg-route .d { animation: tkStop .3s cubic-bezier(.32, .72, 0, 1) .7s both; }
}
@media (prefers-reduced-motion: reduce) { .tk-dlg .btn-p:active { transform: none; } }
@keyframes tkDlgIn { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
@keyframes tkFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes tkRun { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes tkStop { from { opacity: 0; transform: rotate(45deg) scale(.4); } to { opacity: 1; transform: rotate(45deg) scale(1); } }

@media (max-width: 899px) {
	.tk-dlg-in { padding: 24px 20px; }
	.tk-dlg-x { top: 14px; right: 18px; }
	.tk-dlg h2 { font-size: 21px; }
	.tk-dlg-actions { flex-direction: column-reverse; }
	.tk-dlg-actions .btn-p { width: 100%; }
}

/* ---------- 0.5.50 (ARC-0103; site/research/BLUEPRINT-0.5.50-TRACK-TOOL.md) ----------
   The lookup becomes a white card that rises into the bottom of the banner (KAYAK flight tracker), with a 640-760px field and the
   button attached (DHL), a sentence-case label, and an error that tints the field as well as naming the problem (Apple). Square. */
.wf-track-tool { padding-top: 48px !important; padding-bottom: 56px !important; }
.wf-track-tool > .wp-block-group { box-sizing: border-box; max-width: 1360px; margin-inline: auto !important; padding: 0; background: none; }
.wf-track-tool label { font: 600 16px/1.3 var(--wp--preset--font-family--sans); letter-spacing: 0; text-transform: none; color: var(--wp--preset--color--ink); }
.wf-track-tool form > p { gap: 12px; }
.wf-track-tool input[type="text"] { min-height: 64px; padding: 16px 20px; font-size: 18px; transition: border-color 150ms ease-out, background-color 150ms ease-out; }
.wf-track-tool input[type="text"]:hover { border-color: var(--wp--preset--color--ink-2); }
.wf-track-tool input[type="text"]:focus { border-color: var(--wp--preset--color--ink); }
.wf-track-tool button[type="submit"] { min-height: 64px; padding: 0 32px; transition: background-color 150ms ease-out; }
.wf-track-tool button[type="submit"]:hover { background: var(--wp--preset--color--red-press); }
.wf-track-tool button[type="submit"]:active { background: var(--wp--preset--color--red-active); }
.wf-track-tool button[type="submit"]:focus-visible { outline: 2px solid var(--wp--custom--focus); outline-offset: 2px; }
.wf-track-tool form[data-invalid] input[type="text"] { background: var(--wp--preset--color--red-soft); }
.wf-track-tool .tk-err { display: flex; gap: 8px; align-items: flex-start; margin-top: 12px !important; font-size: 14px !important; }
.wf-track-tool .tk-err::before { content: "!"; flex: none; display: grid; place-items: center; width: 18px; height: 18px; margin-top: 2px; background: var(--wp--preset--color--red); font: 700 12px/1 var(--wp--preset--font-family--sans); color: #fff; }
.wf-track-tool p.wf-track-hint { max-width: none; margin-top: 16px !important; padding-top: 16px; border-top: 1px solid var(--wp--preset--color--line); }
@media (max-width: 767px) {
	.wf-track-tool { padding-top: 32px !important; padding-bottom: 40px !important; }
	.wf-track-tool input[type="text"], .wf-track-tool button[type="submit"] { min-height: 56px; }
}
@media (prefers-reduced-motion: reduce) { .wf-track-tool input[type="text"], .wf-track-tool button[type="submit"] { transition: none; } }
/* Owner: the card spans the full content width, as the old bar did, so no dead space sits beside it. The field keeps the left two
   thirds; the hint fills the right third beside it, behind a thin rule. */
@media (min-width: 1024px) {
	.wf-track-tool > .wp-block-group { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); column-gap: 48px; align-items: end; }
	.wf-track-tool > .wp-block-group > * { grid-column: 1; }
	.wf-track-tool > .wp-block-group > p.wf-track-hint { grid-column: 2; grid-row: 1 / span 2; align-self: stretch; display: flex; align-items: flex-end; margin: 0 !important; padding: 0 0 4px 48px; border-top: 0; border-left: 1px solid var(--wp--preset--color--line); font-size: 15px !important; }
}

/* ---------- 0.5.50: the result opens in place under the search, as a status page (DHL inline result; Urban Outfitters,
   adidas, Etsy, Selfridges: status headline, journey steps, reference and help in a side panel). Same wording and buttons. ---------- */
.wf-track-tool .tk-dlg:not(:modal) { scroll-margin-block: 96px 24px; position: static; grid-column: 1 / -1; width: auto; max-width: none; margin: 32px 0 0 !important; padding: 0; color: var(--ink); }
.wf-track-tool .tk-dlg:not(:modal)[open] { display: block; }
html:has(.tk-dlg[open]:not(:modal)) { overflow: visible; }
.wf-track-tool .tk-dlg:not(:modal) .tk-dlg-in { display: grid !important; grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr); grid-template-rows: auto auto 1fr; column-gap: 0; padding: 0; background: #fff; box-shadow: 0 0 0 1px var(--wp--preset--color--line), 0 24px 48px -32px rgba(11, 14, 18, .35); }
.wf-track-tool .tk-dlg:not(:modal) .tk-dlg-route { display: none; }
/* Main column: status, message, journey steps */
.wf-track-tool .tk-dlg:not(:modal) h2 { grid-column: 1; grid-row: 1; display: flex; gap: 12px; align-items: center; padding: 36px 40px 0; font-size: 28px; line-height: 1.2; }
.wf-track-tool .tk-dlg:not(:modal) h2::before { content: "i"; flex: none; display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--wp--preset--color--ink); font: 700 15px/1 var(--wp--preset--font-family--serif); color: #fff; }
.wf-track-tool .tk-dlg:not(:modal) h2 + p { grid-column: 1; grid-row: 2; max-width: 620px; margin: 12px 0 0 !important; padding: 0 40px 0 78px; }
.wf-track-tool .tk-dlg:not(:modal) .tk-steps { grid-column: 1; grid-row: 3; align-self: end; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 32px 0 0; padding: 0 40px 36px; list-style: none; }
.tk-steps li { position: relative; margin: 0; }
.tk-steps li + li::before { content: ""; position: absolute; top: 7px; right: calc(100% - 7px); width: calc(100% - 14px); border-top: 2px dashed var(--wp--preset--color--line-strong); }
.tk-steps a { display: grid; justify-items: start; gap: 10px; color: var(--wp--preset--color--muted); text-decoration: none; }
.tk-step-dot { position: relative; z-index: 1; width: 16px; height: 16px; border: 2px solid var(--wp--preset--color--line-strong); border-radius: 50%; background: #fff; transition: border-color 150ms ease-out; }
.tk-step-l { font: 500 14px/1.35 var(--wp--preset--font-family--sans); text-decoration: underline; text-decoration-color: transparent; text-underline-offset: 3px; transition: color 150ms ease-out, text-decoration-color 150ms ease-out; }
.tk-steps a:hover .tk-step-l, .tk-steps a:focus-visible .tk-step-l { color: var(--wp--preset--color--red); text-decoration-color: currentColor; }
.tk-steps a:hover .tk-step-dot { border-color: var(--wp--preset--color--red); }
.tk-steps a:focus-visible { outline: 2px solid var(--wp--custom--focus); outline-offset: 4px; }
/* Side panel: reference and actions, grouped by track.js */
.wf-track-tool .tk-dlg:not(:modal) .tk-side { grid-column: 2; grid-row: 1 / -1; display: flex; flex-direction: column; padding: 36px 32px 32px; background: var(--wp--preset--color--surface-2); border-left: 1px solid var(--wp--preset--color--line); }
.wf-track-tool .tk-dlg:not(:modal) .tk-side p.tk-dlg-lbl { margin: 0 !important; font: 500 14px/1.3 var(--wp--preset--font-family--sans) !important; letter-spacing: 0; text-transform: none; color: var(--wp--preset--color--muted) !important; }
.wf-track-tool .tk-dlg:not(:modal) .tk-side p.tk-dlg-ref { margin: 6px 0 0 !important; padding: 0; font: 600 28px/1.15 var(--wp--preset--font-family--mono) !important; letter-spacing: .02em; }
.wf-track-tool .tk-dlg:not(:modal) .tk-side .tk-dlg-actions { flex-direction: column; align-items: stretch; gap: 10px; margin: auto 0 0; padding-top: 28px; }
.wf-track-tool .tk-dlg:not(:modal) .tk-dlg-actions .btn-p { width: 100%; height: 52px; }
.wf-track-tool .tk-dlg:not(:modal) #tkDlgMail { order: -1; }
.wf-track-tool .tk-dlg:not(:modal) .btn-p.ink { background: transparent; box-shadow: inset 0 0 0 1px var(--wp--preset--color--ink); color: var(--wp--preset--color--ink); }
.wf-track-tool .tk-dlg:not(:modal) .btn-p.ink:hover { background: var(--wp--preset--color--ink); color: #fff; }
.wf-track-tool .tk-dlg:not(:modal) .tk-dlg-x { top: 12px; right: 12px; z-index: 1; }
@media (prefers-reduced-motion: no-preference) { .wf-track-tool .tk-dlg:not(:modal)[open] { animation: tkResultIn .35s cubic-bezier(.32, .72, 0, 1); } }
@keyframes tkResultIn { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .tk-step-dot, .tk-step-l { transition: none; } }
@media (max-width: 899px) {
	.wf-track-tool .tk-dlg:not(:modal) { margin-top: 24px !important; }
	.wf-track-tool .tk-dlg:not(:modal) .tk-dlg-in { grid-template-columns: minmax(0, 1fr); grid-template-rows: none; }
	.wf-track-tool .tk-dlg:not(:modal) .tk-dlg-in > * { grid-column: 1 !important; grid-row: auto !important; }
	.wf-track-tool .tk-dlg:not(:modal) h2 { order: 1; padding: 24px 52px 0 20px; font-size: 22px; align-items: flex-start; }
	.wf-track-tool .tk-dlg:not(:modal) h2 + p { order: 2; padding: 0 20px; }
	.wf-track-tool .tk-dlg:not(:modal) .tk-steps { order: 3; grid-template-columns: minmax(0, 1fr); gap: 14px; margin-top: 24px; padding: 0 20px 24px; }
	.tk-steps li + li::before { top: auto; bottom: calc(100% - 2px); right: auto; left: 7px; width: 0; height: 18px; border-top: 0; border-left: 2px dashed var(--wp--preset--color--line-strong); }
	.tk-steps a { grid-auto-flow: column; justify-content: start; align-items: center; }
	.wf-track-tool .tk-dlg:not(:modal) .tk-side { order: 4; padding: 20px; border-left: 0; border-top: 1px solid var(--wp--preset--color--line); }
	.wf-track-tool .tk-dlg:not(:modal) .tk-side p.tk-dlg-ref { font-size: 24px !important; }
	.wf-track-tool .tk-dlg:not(:modal) .tk-side .tk-dlg-actions { padding-top: 20px; }
	.wf-track-tool .tk-dlg:not(:modal) .tk-dlg-x { top: 8px; right: 8px; }
}
