/* Mercury Retrograde (Tool 17, prefix mx-) — the status hero, the cycle track and the year directory.
   Loaded through the `styles:` list in retrograde.njk, so it sits in <head>, BEFORE the tool kit's inline <style> blocks.
   Rules are scoped `.mx .x`; where one restyles a kit class it carries one more class than the kit's `.tk .x`, so it outranks it.
   Depends on tokens.css, partials/tool-kit-css.njk and partials/result-kit-css.njk.

   Language: a premium weather API for the sky. One definitive status in 800-weight capitals on the night surface (#0B1020);
   below it a timeline that draws the three parts of a cycle with three weights of the same accent: the shadow before and after as a
   thin, faint track and the retrograde itself as a thick, solid one. No illustration, no emoji. */
.tk.mx {
  --tk-accent: var(--accent-moon, #0284C7);
  --night: var(--bg-ink, #0B1020);
  --night-text: #F8FAFC;
  --night-muted: #94A3B8;
  --night-soft: #CBD5E1;
  --night-line: rgba(248, 250, 252, 0.14);
  --glow: #38BDF8;
  --glow-soft: #7DD3FC;
}
.tk.mx > * + * { margin-top: 16px; }
.tk.mx > .tk-head { margin-bottom: 20px; }
.tk.mx > .tk-head + * { margin-top: 0; }
.tk.mx > .sr-only { margin: 0; }

/* ================= Status hero ================= */
.mx .mx-hero { container: mxh / inline-size; position: relative; overflow: hidden; border-radius: var(--r-card); background: var(--night); color: var(--night-text); padding: 20px 16px 16px; scroll-margin-top: 80px; }
@media (min-width: 720px) { .mx .mx-hero { padding: 32px 40px 24px; } }
.mx .mx-hero > * { position: relative; }
.mx .mx-hero::before { content: ""; position: absolute; right: -25%; top: -35%; width: 100%; aspect-ratio: 1; background: radial-gradient(closest-side, rgba(56, 189, 248, 0.1), rgba(56, 189, 248, 0)); pointer-events: none; }
.mx .mx-hero[data-state="retro"]::before { background: radial-gradient(closest-side, rgba(56, 189, 248, 0.2), rgba(56, 189, 248, 0)); }
.mx .mx-mark { position: absolute; right: -2%; top: 8%; width: min(46%, 300px); height: auto; fill: none; stroke: var(--glow); stroke-width: 0.55; stroke-linecap: round; stroke-linejoin: round; opacity: 0.12; pointer-events: none; }
.mx .mx-hero[data-ready="false"] .mx-status > *, .mx .mx-hero[data-ready="false"] .mx-rail { visibility: hidden; }
.mx .mx-hero :focus-visible { outline: 3px solid color-mix(in srgb, var(--glow) 60%, transparent); outline-offset: 2px; border-radius: 6px; }
.mx .mx-top { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px 20px; }
.mx .mx-eyebrow { margin: 0; font-size: 0.8125rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--glow-soft); }
.mx .mx-check { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 6px 8px; }
.mx .mx-check label { flex-basis: 100%; font-size: 0.75rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--night-muted); }
.mx .mx-check .input { height: 40px; width: 184px; border-color: var(--night-line); background: rgba(248, 250, 252, 0.06); color: var(--night-text); color-scheme: dark; }
.mx .mx-check .input:hover:not(:disabled) { border-color: rgba(248, 250, 252, 0.4); }
.mx .mx-check .input:focus { border-color: var(--glow); box-shadow: 0 0 0 4px rgba(56, 189, 248, 0.2); }
.mx .mx-hero .btn-sm { background: rgba(248, 250, 252, 0.06); border-color: var(--night-line); color: var(--night-text); }
.mx .mx-hero .btn-sm:hover:not(:disabled) { background: rgba(248, 250, 252, 0.14); border-color: rgba(248, 250, 252, 0.3); }
.mx .mx-hero .btn-sm.primary { background: var(--glow); border-color: var(--glow); color: #0B1020; }
.mx .mx-hero .btn-sm.primary:hover:not(:disabled) { background: var(--glow); filter: brightness(1.06); }
.mx .mx-date-hint { margin-top: 6px; font-size: 0.8125rem; color: var(--night-muted); }
.mx .mx-hero .form-error { margin-top: 10px; background: rgba(225, 29, 72, 0.14); border-color: rgba(251, 113, 133, 0.5); color: #FDA4AF; }
.mx .mx-noscript { margin-top: 12px; padding: 10px 14px; border: 1px solid var(--night-line); border-radius: 12px; font-size: 0.9375rem; font-weight: 600; color: var(--night-soft); }

/* the badge: the status, as large as the container allows */
.mx .mx-status { margin-top: 22px; min-width: 0; }
.mx .mx-badge { margin: 0; font-size: clamp(2.125rem, 9.6cqw, 6rem); font-weight: 800; letter-spacing: -0.04em; line-height: 0.95; text-transform: uppercase; text-wrap: balance; color: var(--night-soft); }
.mx .mx-hero[data-state="approach"] .mx-badge { color: var(--glow-soft); }
.mx .mx-hero[data-state="retro"] .mx-badge { color: var(--glow); text-shadow: 0 0 60px rgba(56, 189, 248, 0.38); }
.mx .mx-hero[data-state="exit"] .mx-badge { color: var(--glow-soft); }
.mx .mx-line { margin-top: 16px; max-width: 46ch; font-size: clamp(1.0625rem, 0.95rem + 0.6vw, 1.3125rem); font-weight: 700; line-height: 1.35; color: #E2E8F0; }
.mx .mx-detail { margin-top: 8px; max-width: 60ch; font-size: 1rem; font-weight: 600; color: var(--night-muted); }

/* the cycle under the badge */
.mx .mx-cyclebar { margin-top: 26px; }
.mx .mx-hero .mx-track { --c-accent: var(--glow); }
.mx .mx-cyclebar-cap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2px 14px; margin-top: 8px; font-size: 0.8125rem; font-weight: 600; color: var(--night-muted); }

/* the four stages */
.mx .mx-rail { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 22px 0 0; padding: 18px 0 0; border-top: 1px solid var(--night-line); }
@container mxh (min-width: 640px) { .mx .mx-rail { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; } }
.mx .mx-rail li { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 0 10px; align-items: baseline; color: var(--night-muted); }
.mx .mx-rail li b { font-size: 0.9375rem; font-weight: 800; letter-spacing: -0.01em; }
.mx .mx-rail li span:last-child { grid-column: 2; font-size: 0.8125rem; font-weight: 600; }
.mx .mx-rail-dot { width: 12px; height: 12px; border-radius: 50%; border: 2px solid currentColor; align-self: center; }
.mx .mx-rail li[data-state="approach"] .mx-rail-dot, .mx .mx-rail li[data-state="exit"] .mx-rail-dot { opacity: 0.55; }
.mx .mx-rail li.is-on { color: var(--night-text); }
.mx .mx-rail li.is-on .mx-rail-dot { background: var(--glow); border-color: var(--glow); box-shadow: 0 0 0 4px rgba(56, 189, 248, 0.25); opacity: 1; }
.mx .mx-rail li.is-on span:last-child { color: var(--night-soft); }

.mx .mx-hero .rk-actions { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--night-line); justify-content: flex-start; }
.mx .mx-hero .fine-print { color: var(--night-muted); }

/* ================= The cycle track (shared by the hero and every card) ================= */
.mx .mx-trackwrap { position: relative; margin-top: 14px; }
.mx .mx-track { display: flex; align-items: center; gap: 4px; height: 28px; }
.mx .mx-track .mx-seg { display: block; min-width: 6px; border-radius: 999px; background: var(--c-accent); }
.mx .mx-track .mx-seg.pre, .mx .mx-track .mx-seg.post { height: 8px; opacity: 0.3; }
.mx .mx-track .mx-seg.retro { height: 24px; opacity: 1; }
.mx .mx-now { position: absolute; top: -8px; bottom: -8px; width: 3px; margin-left: -1.5px; border-radius: 2px; background: var(--c-ink); }
.mx .mx-hero .mx-now { background: var(--night-text); }
.mx .mx-now::before { content: ""; position: absolute; left: 50%; top: -2px; width: 11px; height: 8px; transform: translateX(-50%); background: inherit; clip-path: polygon(0 0, 100% 0, 50% 100%); }

/* ================= Directory ================= */
.mx .mx-legend { display: grid; gap: 10px 22px; margin-bottom: 18px; }
@media (min-width: 720px) { .mx .mx-legend { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.mx .mx-legend li { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 0 12px; align-items: center; font-size: 0.875rem; color: var(--c-muted); }
.mx .mx-legend li b { color: var(--c-ink); font-weight: 800; }
.mx .mx-legend li span:last-child { grid-column: 2; }
.mx .mx-key { grid-row: 1 / span 2; display: block; width: 44px; border-radius: 999px; background: var(--c-accent); }
.mx .mx-key.pre, .mx .mx-key.post { height: 8px; opacity: 0.3; }
.mx .mx-key.retro { height: 20px; }

.mx .mx-years { position: sticky; top: 56px; z-index: 5; display: flex; gap: 6px; margin: 0 -4px 14px; padding: 8px 4px; overflow-x: auto; background: color-mix(in srgb, var(--c-card) 94%, transparent); backdrop-filter: blur(6px); scrollbar-width: thin; }
.mx .mx-years button { flex: none; min-width: 64px; min-height: 40px; padding: 0 14px; border: 1px solid var(--c-line); border-radius: 10px; background: #fff; font: inherit; font-size: 0.9375rem; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--c-ink); cursor: pointer; transition: background 0.15s, border-color 0.15s; }
.mx .mx-years button:hover { background: var(--c-accent-tint); }
.mx .mx-years button[aria-pressed="true"] { background: var(--c-ink); border-color: var(--c-ink); color: #fff; }
.mx .mx-years button.is-now { box-shadow: inset 0 -3px 0 var(--c-accent); }

.mx .mx-year[hidden] { display: none; }
.mx .mx-year + .mx-year { margin-top: 36px; }
.mx .mx-year-h { display: flex; align-items: baseline; gap: 12px; font-size: clamp(1.75rem, 1.3rem + 1.8vw, 2.5rem); font-weight: 800; letter-spacing: -0.03em; line-height: 1; }
.mx .mx-count { font-size: 0.875rem; font-weight: 600; letter-spacing: 0; color: var(--c-muted); }

/* the year strip: twelve months, every cycle as the same three weights */
.mx .mx-strip { margin-top: 14px; }
.mx .mx-months { position: relative; height: 18px; border-bottom: 1px solid var(--c-line); }
.mx .mx-months span { position: absolute; bottom: 2px; padding-left: 4px; font-size: 0.6875rem; font-weight: 700; letter-spacing: 0.06em; color: var(--c-muted); }
.mx .mx-months span::before { content: ""; position: absolute; left: 0; bottom: -3px; height: 8px; border-left: 1px solid var(--c-line); }
.mx .mx-bars { position: relative; height: 44px; }
.mx .mx-bar { position: absolute; inset: 0; }
.mx .mx-bar .mx-seg { position: absolute; top: 50%; display: block; border-radius: 999px; background: var(--c-accent); transform: translateY(-50%); }
.mx .mx-bar .mx-seg.pre, .mx .mx-bar .mx-seg.post { height: 8px; opacity: 0.3; }
.mx .mx-bar .mx-seg.retro { height: 24px; }
.mx .mx-yearnow { position: absolute; top: 4px; bottom: 4px; width: 3px; margin-left: -1.5px; border-radius: 2px; background: var(--c-ink); }

.mx .mx-cycles { display: grid; gap: 14px; margin-top: 16px; }
@media (min-width: 960px) { .mx .mx-cycles { grid-template-columns: repeat(2, minmax(0, 1fr)); } .mx .mx-cycles .mx-cycle:last-child:nth-child(odd) { grid-column: 1 / -1; } }
.mx .mx-cycle { padding: 20px; border: 1px solid var(--c-line); border-radius: var(--r-box); background: #fff; min-width: 0; scroll-margin-top: 120px; }
.mx .mx-cycle[data-rel="past"] { background: #FAFBFC; }
.mx .mx-cycle[data-rel="past"] .mx-range { color: #475569; }
.mx .mx-cycle[data-rel="now"] { border-color: var(--c-accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--c-accent) 18%, transparent); }
.mx .mx-cycle-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.mx .mx-cycle-kick { margin: 0; font-size: 0.75rem; font-weight: 700; letter-spacing: 0.09em; text-transform: uppercase; color: var(--c-muted); }
.mx .mx-range { margin-top: 2px; font-size: clamp(1.25rem, 1.05rem + 0.9vw, 1.625rem); font-weight: 800; letter-spacing: -0.02em; line-height: 1.15; }
.mx .mx-tag { flex: none; display: none; align-items: center; height: 26px; padding: 0 10px; border-radius: 999px; border: 1px solid var(--c-line); font-size: 0.75rem; font-weight: 700; letter-spacing: 0.04em; color: var(--c-muted); }
.mx .mx-cycle[data-rel] .mx-tag { display: inline-flex; }
.mx .mx-cycle[data-rel="now"] .mx-tag { background: var(--c-accent); border-color: var(--c-accent); color: #fff; }
.mx .mx-cycle[data-rel="next"] .mx-tag { border-color: color-mix(in srgb, var(--c-accent) 50%, #fff); color: var(--c-accent-ink); }
.mx .mx-carry { margin-top: 6px; font-size: 0.8125rem; color: var(--c-muted); }
.mx .mx-dates { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 16px; margin-top: 18px; }
@media (min-width: 560px) { .mx .mx-dates { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.mx .mx-dates dt { font-size: 0.6875rem; font-weight: 700; letter-spacing: 0.09em; text-transform: uppercase; color: var(--c-muted); }
.mx .mx-dates dd { margin-top: 2px; font-size: 1.1875rem; font-weight: 800; letter-spacing: -0.01em; white-space: nowrap; }
.mx .mx-dates .mx-date-startShadow dd, .mx .mx-dates .mx-date-endShadow dd { font-weight: 700; color: #475569; }
.mx .mx-dates .mx-date-startRetrograde dd, .mx .mx-dates .mx-date-endRetrograde dd { color: var(--c-accent-ink); }
.mx .mx-durs { display: flex; flex-wrap: wrap; gap: 2px 14px; margin-top: 12px; font-size: 0.8125rem; color: var(--c-muted); }
.mx .mx-zodiac { margin-top: 14px; padding-top: 14px; border-top: 1px dashed var(--c-line); }
.mx .mx-signs { display: flex; flex-wrap: wrap; gap: 6px 8px; }
.mx .mx-sign { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px 0 8px; border-radius: 999px; background: var(--c-accent-tint); font-size: 0.875rem; font-weight: 700; color: var(--c-accent-ink); }
.mx .mx-sign svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.mx .mx-zone { margin-top: 10px; font-size: 0.9375rem; font-weight: 600; }
.mx .mx-zone b { margin-right: 4px; font-size: 0.6875rem; font-weight: 700; letter-spacing: 0.09em; text-transform: uppercase; color: var(--c-muted); }
.mx .mx-stations { margin-top: 2px; font-size: 0.8125rem; color: var(--c-muted); }
.mx .mx-tz { margin-top: 20px; font-size: 0.8125rem; color: var(--c-muted); }

/* ================= Method ================= */
.mx .mx-rules { display: grid; gap: 14px 28px; }
@media (min-width: 720px) { .mx .mx-rules { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.mx .mx-rules dt { font-weight: 800; letter-spacing: -0.01em; }
.mx .mx-rules dd { margin-top: 2px; color: var(--c-muted); font-size: 0.9375rem; }
