/* ============================================================================
   JuHost — standalone tools stylesheet  (v1.0.0)
   ----------------------------------------------------------------------------
   A dependency-free, dark brand skin for the JuHost utility pages that live on
   OTHER servers than the marketing site:

     · Speedtest  (LibreSpeed)      e.g. hknt.st.juhost.com
     · Looking Glass (Telephone LG) e.g. hknt.lg.juhost.com

   Those hosts are per-facility probe boxes — they must NOT carry a copy of the
   site build. So they link this ONE file over the wire:

       <link rel="stylesheet" href="https://juhost.com/brand/juhost-tools.css?v=1.0.0">

   It ships from juhost-new/public/, which Vite copies verbatim into dist/, so a
   normal site release publishes it at /brand/juhost-tools.css. Nothing else is
   needed on the probe box: no Bootstrap, no jQuery UI kit, no font files, no
   logo image (the mark is inline SVG in each page).

   ⚠ Cross-origin fonts: the @font-face files below are fetched by a document on
   a DIFFERENT origin, so the CORS gate applies to them. juhost-new/public/
   .htaccess sends `Access-Control-Allow-Origin: *` for /fonts/ and /brand/ —
   keep that rule or the pages silently fall back to system sans.

   Token source of truth ........... juhost-new/tailwind.config.js
   Global CSS reference ............ juhost-new/src/index.css
   Chrome reference ................ juhost-new/src/components/layout/*
   Sibling implementation .......... whmcs/26juhost/css/custom.css
   Bump the ?v= in BOTH pages when this file changes.
   ========================================================================== */

/* ==========================================================================
   1. Brand fonts — self-hosted on juhost.com, mirrored from src/fonts.css
   Paths are relative to THIS file (/brand/), so they resolve to /fonts/ on the
   site origin regardless of which probe host loads the sheet.
   Only the weights the tool pages actually use are declared (Inter 400/500/600,
   Space Grotesk 600/700, IBM Plex Mono 400/500) — the woff2 files are the same
   ones the site preloads, so a visitor arriving from juhost.com gets them warm.
   ========================================================================== */

/* Inter 400 / 500 / 600 — latin + latin-ext (one variable file per subset) */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(../fonts/inter-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(../fonts/inter-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url(../fonts/inter-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url(../fonts/inter-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url(../fonts/inter-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url(../fonts/inter-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* Space Grotesk 600 / 700 — display face */
@font-face {
  font-family: 'Space Grotesk';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url(../fonts/space-grotesk-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Space Grotesk';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url(../fonts/space-grotesk-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Space Grotesk';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url(../fonts/space-grotesk-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Space Grotesk';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url(../fonts/space-grotesk-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* IBM Plex Mono 400 / 500 — every number and every command output */
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(../fonts/ibm-plex-mono-400-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(../fonts/ibm-plex-mono-400-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url(../fonts/ibm-plex-mono-500-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url(../fonts/ibm-plex-mono-500-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* ==========================================================================
   2. Design tokens — 1:1 with juhost-new/tailwind.config.js
   ========================================================================== */

:root {
  /* — Infrastructure ink (backgrounds & surfaces) — */
  --ju-ink-950: #05070d;
  --ju-ink-900: #080b14;
  --ju-ink-850: #0b0f1a;
  --ju-ink-800: #101624;
  --ju-ink-750: #141c2c;
  --ju-ink-700: #1b2538;
  --ju-ink-600: #283447;
  --ju-ink-500: #3a4862;
  --ju-ink-400: #5a6b86;

  /* — Electric cyan accent (used sparingly) — */
  --ju-accent-300: #7de7f7;
  --ju-accent-400: #34d3ee;
  --ju-accent-500: #13b8d8;
  --ju-accent-600: #0e94b0;

  /* — Azure blue (links / data points) — */
  --ju-azure-300: #7cc4fb;
  --ju-azure-400: #48a8f5;
  --ju-azure-500: #1e88e5;

  /* — Signal colours for live metrics — */
  --ju-green-400: #4ade80;
  --ju-amber-400: #fbbf24;
  --ju-red-400: #f87171;

  /* — Text — */
  --ju-white: #ffffff;
  --ju-text: #cbd5e1;       /* slate-300 — body */
  --ju-text-muted: #94a3b8; /* slate-400 */
  --ju-text-faint: #64748b; /* slate-500 */

  /* — Lines & surfaces — */
  --ju-border: rgba(255, 255, 255, 0.1);
  --ju-border-strong: rgba(255, 255, 255, 0.16);
  --ju-surface: rgba(11, 15, 26, 0.7);
  --ju-hover: rgba(255, 255, 255, 0.04);

  /* — Shape — */
  --ju-radius: 0.75rem;
  --ju-radius-lg: 1.125rem;
  --ju-shadow-glow: 0 0 0 1px rgba(52, 211, 238, 0.18), 0 20px 60px -20px rgba(19, 184, 216, 0.35);
  --ju-shadow-panel: 0 24px 70px -30px rgba(0, 0, 0, 0.85);

  /* — Type — */
  --ju-font-sans: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, 'Noto Sans TC', 'Noto Sans SC', 'PingFang HK', 'Microsoft JhengHei', sans-serif;
  --ju-font-display: 'Space Grotesk', 'Inter', system-ui, sans-serif;
  --ju-font-mono: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, monospace;

  /* — Chrome metrics — */
  --ju-header-h: 64px;

  color-scheme: dark;
}

@media (min-width: 640px) {
  :root { --ju-header-h: 72px; }
}

/* ==========================================================================
   3. Reset & base
   ========================================================================== */

*,
*::before,
*::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  background-color: var(--ju-ink-950);
  color: var(--ju-text);
  font-family: var(--ju-font-sans);
  font-size: 16px;
  line-height: 1.6;
  /* Radial cyan/azure glows, straight from juhost-new src/index.css */
  background-image:
    radial-gradient(900px 500px at 80% -10%, rgba(19, 184, 216, 0.1), transparent 60%),
    radial-gradient(800px 600px at 0% 0%, rgba(30, 136, 229, 0.08), transparent 55%);
  background-repeat: no-repeat;
}

/* Fixed attachment only on pointer-capable desktop — avoids iOS Safari jank */
@media (min-width: 1024px) and (hover: hover) {
  body { background-attachment: fixed; }
}

h1, h2, h3, h4 {
  margin: 0;
  font-family: var(--ju-font-display);
  color: var(--ju-white);
  line-height: 1.2;
  text-wrap: balance;
}

p { margin: 0; }

a {
  color: var(--ju-azure-400);
  text-decoration: none;
  transition: color 0.2s ease;
}
a:hover,
a:focus-visible { color: var(--ju-accent-300); }

img, svg { display: block; max-width: 100%; }

::selection {
  background: rgba(19, 184, 216, 0.3);
  color: var(--ju-white);
}

:focus-visible {
  outline: 2px solid var(--ju-accent-400);
  outline-offset: 2px;
  border-radius: 4px;
}

/* Thin, on-brand scrollbar */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--ju-ink-900); }
::-webkit-scrollbar-thumb {
  background: var(--ju-ink-700);
  border-radius: 9999px;
  border: 2px solid var(--ju-ink-900);
}
::-webkit-scrollbar-thumb:hover { background: var(--ju-ink-600); }

/* Screen-reader-only helper */
.ju-sr {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ==========================================================================
   4. Layout primitives
   ========================================================================== */

.ju-container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.25rem;
}
@media (min-width: 640px) {
  .ju-container { padding: 0 2rem; }
}

/* Page body sits below the fixed header */
.ju-main {
  padding-top: calc(var(--ju-header-h) + 2.5rem);
  padding-bottom: 4rem;
}

.ju-page-head {
  text-align: center;
  margin-bottom: 2.5rem;
}
.ju-page-head h1 {
  font-size: clamp(1.85rem, 4.2vw, 2.75rem);
  font-weight: 700;
  letter-spacing: -0.02em;
}
.ju-page-head .ju-lede {
  margin: 0.9rem auto 0;
  max-width: 46rem;
  color: var(--ju-text-muted);
  font-size: 0.95rem;
}

/* Eyebrow / kicker label above a title */
.ju-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.85rem;
  font-family: var(--ju-font-mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  color: var(--ju-accent-400);
}
.ju-eyebrow::before {
  content: '';
  width: 1.75rem;
  height: 1px;
  background: rgba(19, 184, 216, 0.6);
}

.ju-hairline {
  height: 1px;
  width: 100%;
  border: 0;
  background: linear-gradient(to right, transparent, rgba(255, 255, 255, 0.1), transparent);
}

/* Surface card */
.ju-card {
  position: relative;
  border: 1px solid var(--ju-border);
  border-radius: var(--ju-radius-lg);
  background: var(--ju-surface);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  transition: border-color 0.3s ease, background-color 0.3s ease, box-shadow 0.3s ease;
}
.ju-card-hover:hover {
  border-color: rgba(19, 184, 216, 0.4);
  background: rgba(16, 22, 36, 0.8);
  box-shadow: var(--ju-shadow-glow);
}

.ju-card-title {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--ju-font-mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--ju-text-faint);
  margin-bottom: 1.1rem;
}

/* ==========================================================================
   5. Header / navigation
   ========================================================================== */

.ju-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 50;
  border-bottom: 1px solid transparent;
  transition: background-color 0.3s ease, border-color 0.3s ease;
}
/* .is-scrolled is toggled by juhost-tools.js; mirrors the site header */
.ju-header.is-scrolled,
.ju-header.is-open {
  border-bottom-color: var(--ju-border);
  background: rgba(5, 7, 13, 0.85);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}

.ju-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  height: var(--ju-header-h);
}

/* — Logo (inline SVG mark + wordmark) — */
.ju-logo {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  flex-shrink: 0;
}
.ju-logo svg {
  overflow: visible;
  filter: drop-shadow(0 0 0 rgba(52, 211, 238, 0));
  transition: filter 0.3s ease-out;
}
.ju-logo:hover svg,
.ju-logo:focus-visible svg { filter: drop-shadow(0 0 7px rgba(52, 211, 238, 0.6)); }

.ju-wordmark {
  font-family: var(--ju-font-display);
  font-size: 1.125rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ju-white);
}
.ju-wordmark b {
  font-weight: 700;
  color: var(--ju-accent-400);
  transition: color 0.3s ease-out, text-shadow 0.3s ease-out;
}
.ju-logo:hover .ju-wordmark b,
.ju-logo:focus-visible .ju-wordmark b {
  color: var(--ju-accent-300);
  text-shadow: 0 0 12px rgba(52, 211, 238, 0.55);
}

/* — Desktop nav — */
.ju-nav {
  display: none;
  align-items: center;
  gap: 2rem;
}
.ju-nav a {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--ju-text);
  transition: color 0.2s ease;
}
.ju-nav a:hover { color: var(--ju-white); }

.ju-header-actions {
  display: none;
  align-items: center;
  gap: 0.75rem;
}

@media (min-width: 1024px) {
  .ju-nav,
  .ju-header-actions { display: flex; }
  .ju-mobile-actions { display: none !important; }
}

/* — Mobile — */
.ju-mobile-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.ju-burger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  border: 1px solid var(--ju-border);
  border-radius: 0.5rem;
  background: transparent;
  color: var(--ju-text);
  cursor: pointer;
  transition: border-color 0.2s ease, color 0.2s ease;
}
.ju-burger:hover {
  border-color: rgba(19, 184, 216, 0.4);
  color: var(--ju-white);
}
.ju-burger .ju-icon-close { display: none; }
.ju-header.is-open .ju-burger .ju-icon-open { display: none; }
.ju-header.is-open .ju-burger .ju-icon-close { display: block; }

.ju-mobile-panel {
  display: none;
  border-top: 1px solid var(--ju-border);
  padding: 1rem 0 1.5rem;
}
.ju-header.is-open .ju-mobile-panel { display: block; }
@media (min-width: 1024px) {
  .ju-header.is-open .ju-mobile-panel { display: none; }
}
.ju-mobile-panel a {
  display: block;
  padding: 0.7rem 0.25rem;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--ju-text);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}
.ju-mobile-panel a:hover { color: var(--ju-white); }
.ju-mobile-panel .ju-btn {
  display: flex;
  margin-top: 1.1rem;
  border-bottom: 0;
}

/* ==========================================================================
   6. Language switcher
   ========================================================================== */

.ju-lang { position: relative; }

.ju-lang-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--ju-border);
  border-radius: 0.5rem;
  background: transparent;
  color: var(--ju-text);
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.2;
  cursor: pointer;
  transition: border-color 0.2s ease, color 0.2s ease;
}
.ju-lang-btn:hover {
  border-color: rgba(19, 184, 216, 0.4);
  color: var(--ju-white);
}
.ju-lang-btn svg:first-child { color: var(--ju-accent-400); }
.ju-lang-btn .ju-chevron { transition: transform 0.2s ease; }
.ju-lang.is-open .ju-lang-btn .ju-chevron { transform: rotate(180deg); }

.ju-lang-menu {
  display: none;
  position: absolute;
  right: 0;
  top: calc(100% + 0.5rem);
  z-index: 60;
  width: 11rem;
  margin: 0;
  padding: 0.25rem;
  list-style: none;
  border: 1px solid var(--ju-border);
  border-radius: var(--ju-radius);
  background: rgba(11, 15, 26, 0.95);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  box-shadow: var(--ju-shadow-panel);
}
.ju-lang.is-open .ju-lang-menu { display: block; }

.ju-lang-menu button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 0.5rem 0.75rem;
  border: 0;
  border-radius: 0.5rem;
  background: transparent;
  color: var(--ju-text);
  font-family: inherit;
  font-size: 0.875rem;
  text-align: left;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease;
}
.ju-lang-menu button:hover {
  background: var(--ju-hover);
  color: var(--ju-white);
}
.ju-lang-menu button[aria-selected='true'] {
  background: var(--ju-hover);
  color: var(--ju-white);
}
.ju-lang-menu button .ju-check {
  display: none;
  color: var(--ju-accent-400);
}
.ju-lang-menu button[aria-selected='true'] .ju-check { display: block; }

/* ==========================================================================
   7. Buttons
   ========================================================================== */

.ju-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.25rem;
  border: 1px solid transparent;
  border-radius: 0.5rem;
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
  cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.ju-btn-primary {
  background: var(--ju-accent-500);
  color: var(--ju-ink-950);
  box-shadow: 0 10px 30px -12px rgba(19, 184, 216, 0.7);
}
.ju-btn-primary:hover {
  background: var(--ju-accent-400);
  color: var(--ju-ink-950);
}

.ju-btn-ghost {
  border-color: var(--ju-border);
  background: transparent;
  color: var(--ju-text);
}
.ju-btn-ghost:hover {
  border-color: rgba(19, 184, 216, 0.5);
  background: rgba(255, 255, 255, 0.03);
  color: var(--ju-white);
}

.ju-btn-danger {
  background: transparent;
  border-color: rgba(248, 113, 113, 0.5);
  color: #fca5a5;
}
.ju-btn-danger:hover {
  background: rgba(248, 113, 113, 0.1);
  border-color: rgba(248, 113, 113, 0.75);
  color: #fecaca;
}

.ju-btn[disabled] {
  opacity: 0.55;
  cursor: not-allowed;
  box-shadow: none;
}

/* ==========================================================================
   8. Forms
   ========================================================================== */

.ju-field {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  min-width: 0;
}

.ju-label {
  font-family: var(--ju-font-mono);
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--ju-text-faint);
}

.ju-input,
.ju-select {
  width: 100%;
  padding: 0.7rem 0.9rem;
  border: 1px solid var(--ju-border);
  border-radius: 0.5rem;
  background: rgba(5, 7, 13, 0.6);
  color: var(--ju-white);
  font-family: var(--ju-font-mono);
  font-size: 0.9rem;
  line-height: 1.4;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  -webkit-appearance: none;
  appearance: none;
}
.ju-input::placeholder { color: var(--ju-text-faint); }
.ju-input:focus,
.ju-select:focus {
  outline: none;
  border-color: rgba(52, 211, 238, 0.6);
  box-shadow: 0 0 0 3px rgba(19, 184, 216, 0.15);
}

/* Native select arrow, drawn as a data-URI chevron so no image request */
.ju-select {
  padding-right: 2.25rem;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.7rem center;
  background-size: 1rem;
}
.ju-select option {
  background: var(--ju-ink-850);
  color: var(--ju-white);
}

/* Invalid state — LookingGlass.js toggles .error on the wrapper */
.error .ju-input {
  border-color: rgba(248, 113, 113, 0.7);
  box-shadow: 0 0 0 3px rgba(248, 113, 113, 0.12);
}

/* ==========================================================================
   9. Terminal-style output
   ========================================================================== */

.ju-output {
  margin: 0;
  padding: 1.1rem 1.25rem;
  max-height: 34rem;
  overflow: auto;
  border: 1px solid var(--ju-border);
  border-radius: var(--ju-radius);
  background: rgba(5, 7, 13, 0.75);
  color: var(--ju-text);
  font-family: var(--ju-font-mono);
  font-size: 0.8rem;
  line-height: 1.65;
  white-space: pre-wrap;
  word-break: break-word;
  -moz-tab-size: 4;
  tab-size: 4;
}

/* ==========================================================================
   10. Footer — mirrors juhost-new/src/components/layout/Footer.tsx
   ========================================================================== */

.ju-footer {
  position: relative;
  border-top: 1px solid var(--ju-border);
  background: rgba(8, 11, 20, 0.6);
}
.ju-footer-inner { padding: 4rem 0 2.5rem; }

.ju-footer-grid {
  display: grid;
  gap: 3rem;
}
@media (min-width: 1024px) {
  .ju-footer-grid { grid-template-columns: 1.4fr 3fr; }
}

.ju-footer-tagline {
  margin-top: 1.25rem;
  max-width: 24rem;
  color: var(--ju-text-muted);
  font-size: 0.875rem;
  line-height: 1.7;
  white-space: pre-line;
}

.ju-footer-cols {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 2rem;
}
@media (min-width: 640px) {
  .ju-footer-cols { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

.ju-footer-cols h3 {
  font-family: var(--ju-font-mono);
  font-size: 0.72rem;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--ju-text-faint);
}
.ju-footer-cols ul {
  margin: 1rem 0 0;
  padding: 0;
  list-style: none;
}
.ju-footer-cols li + li { margin-top: 0.75rem; }
.ju-footer-cols a {
  font-size: 0.875rem;
  color: var(--ju-text-muted);
}
.ju-footer-cols a:hover { color: var(--ju-accent-300); }

.ju-footer-bottom {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 1.5rem;
  font-size: 0.75rem;
  color: var(--ju-text-faint);
}
@media (min-width: 640px) {
  .ju-footer-bottom {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}

/* ==========================================================================
   11. Speedtest module
   ========================================================================== */

.st-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  margin-bottom: 2.5rem;
}

.st-start {
  min-width: 12rem;
  padding: 0.95rem 2rem;
  font-size: 0.95rem;
}
/* Running state: the same button becomes the abort control */
.st-start .st-label-abort { display: none; }
.st-start.is-running .st-label-start { display: none; }
.st-start.is-running .st-label-abort { display: inline; }

.st-progress {
  position: relative;
  width: min(100%, 34rem);
  height: 4px;
  overflow: hidden;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.07);
}
.st-progress-bar {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0;
  border-radius: 9999px;
  background: linear-gradient(90deg, var(--ju-azure-500), var(--ju-accent-400));
  box-shadow: 0 0 18px rgba(19, 184, 216, 0.55);
  transition: width 0.6s ease;
}

.st-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}
@media (min-width: 768px) {
  .st-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

.st-tile {
  padding: 1.5rem 1.25rem;
  text-align: center;
}
.st-tile-name {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  font-family: var(--ju-font-mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--ju-text-faint);
}
.st-tile-name svg { color: var(--ju-accent-400); }

.st-value {
  margin-top: 0.85rem;
  font-family: var(--ju-font-mono);
  font-size: clamp(1.9rem, 6vw, 2.5rem);
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.1;
  color: var(--ju-white);
  font-variant-numeric: tabular-nums;
}
/* Placeholder zero while idle, so tiles never collapse */
.st-value:empty::before {
  content: '0.00';
  color: var(--ju-ink-500);
}
.st-tile[data-metric='dl'] .st-value:not(:empty) { color: var(--ju-accent-300); }
.st-tile[data-metric='ul'] .st-value:not(:empty) { color: var(--ju-azure-300); }
.st-tile[data-metric='ping'] .st-value:not(:empty),
.st-tile[data-metric='jitter'] .st-value:not(:empty) { color: var(--ju-white); }

.st-unit {
  margin-top: 0.35rem;
  font-family: var(--ju-font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  color: var(--ju-text-faint);
}

/* Client IP strip below the tiles */
.st-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  margin-top: 2rem;
  padding: 0.85rem 1.25rem;
  font-size: 0.8rem;
  color: var(--ju-text-muted);
}
.st-meta .st-ip {
  font-family: var(--ju-font-mono);
  color: var(--ju-white);
  word-break: break-all;
}
.st-meta .st-ip:empty::before {
  content: '—';
  color: var(--ju-text-faint);
}

.st-note {
  margin-top: 1.75rem;
  text-align: center;
  font-size: 0.8rem;
  color: var(--ju-text-faint);
}

/* ==========================================================================
   12. Looking Glass module
   ========================================================================== */

.lg-grid {
  display: grid;
  gap: 1.25rem;
  margin-bottom: 1.25rem;
}
@media (min-width: 900px) {
  .lg-grid { grid-template-columns: 1fr 1fr; }
}

.lg-panel { padding: 1.5rem; }

/* Definition rows in "network information" */
.lg-dl {
  display: grid;
  grid-template-columns: minmax(6.5rem, auto) 1fr;
  gap: 0.7rem 1.25rem;
  margin: 0;
  font-size: 0.875rem;
}
.lg-dl dt {
  color: var(--ju-text-faint);
}
.lg-dl dd {
  margin: 0;
  font-family: var(--ju-font-mono);
  color: var(--ju-text);
  word-break: break-all;
}

/* Test-file download chips */
.lg-files {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.lg-file {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.7rem;
  border: 1px solid var(--ju-border);
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.02);
  color: var(--ju-text);
  font-family: var(--ju-font-mono);
  font-size: 0.78rem;
  transition: border-color 0.2s ease, color 0.2s ease, background-color 0.2s ease;
}
.lg-file:hover {
  border-color: rgba(19, 184, 216, 0.5);
  background: rgba(19, 184, 216, 0.08);
  color: var(--ju-accent-300);
}

/* "Your IP" — click to copy into the host field */
.lg-yourip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--ju-font-mono);
  color: var(--ju-accent-300);
  cursor: pointer;
  border-bottom: 1px dashed rgba(125, 231, 247, 0.4);
}
.lg-yourip:hover { border-bottom-color: var(--ju-accent-300); }

.lg-hint {
  margin-top: 0.5rem;
  font-size: 0.75rem;
  color: var(--ju-text-faint);
}

/* Query form */
.lg-form {
  display: grid;
  gap: 1rem;
}
@media (min-width: 560px) {
  .lg-form { grid-template-columns: 1fr 12rem; }
  .lg-form .lg-submit { grid-column: 1 / -1; }
}

.lg-submit { width: 100%; }

.lg-results { margin-top: 1.25rem; }

/* Live status dot next to the results heading */
.lg-status {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin-left: auto;
  font-family: var(--ju-font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  color: var(--ju-text-faint);
}
.lg-status::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--ju-ink-500);
}
.lg-status.is-live::before {
  background: var(--ju-accent-400);
  box-shadow: 0 0 8px rgba(52, 211, 238, 0.9);
  animation: ju-pulse 1.4s ease-in-out infinite;
}

@keyframes ju-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

/* ==========================================================================
   13. Motion preferences
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
