/* ============================================
   ALPHA IT Services - IT Tools Platform
   Matches the Support Hub / Remote portal
   (components/chrome/chrome.css): navy chrome,
   white cards, Plus Jakarta Sans.
   ============================================ */

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

:root {
    --navy: #080f1e;
    --navy-2: #0f1a2e;
    --primary: #0053CE;
    --primary-600: #0048b5;
    --accent: #00a5ff;
    --sky: #9fd8ff;
    --ink: #0b1324;
    --muted: #4b5568;
    --line: #dbe3ef;
    --paper: #f4f7fb;

    /* Names used by app.js / tools.js inline styles */
    --bg: var(--paper);
    --bg2: #ffffff;
    --bg3: #f4f7fb;
    --bg4: #eaf0f7;
    --bg5: #dbe3ef;
    --blue: var(--primary);
    --blue-h: var(--primary-600);
    --blue-d: #003a93;
    --blue-light: #eaf3ff;
    --blue-glow: rgba(0, 83, 206, .08);
    --text: var(--ink);
    --text2: var(--muted);
    --text3: #7a8597;
    --border: var(--line);
    --border2: #c4d1e3;
    --green: #15803d;
    --green-bg: #ecfdf3;
    --red: #b91c1c;
    --red-bg: #fdecec;
    --yellow: #a16207;
    --yellow-bg: #fefce8;
    --cyan: #0e7490;
    --cyan-bg: #ecfeff;
    --purple: #6d28d9;
    --orange: #c2410c;

    --radius: 18px;
    --radius-sm: 12px;
    --font: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
    --mono: 'Fira Code', 'Fira Mono', Consolas, monospace;
    --shadow: 0 1px 2px rgba(8,15,30,.04), 0 6px 16px -10px rgba(8,15,30,.18);
    --shadow-md: 0 18px 40px -24px rgba(8,15,30,.35), 0 2px 6px rgba(8,15,30,.05);
    --shadow-lg: 0 30px 60px -30px rgba(8,15,30,.35), 0 2px 6px rgba(8,15,30,.05);
    --transition: .15s ease;
}

html { scroll-behavior: smooth; }
body {
    font-family: var(--font);
    background: var(--paper);
    color: var(--ink);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 6px; }

.skip-link {
    position: absolute; left: 12px; top: -60px; z-index: 200;
    background: #fff; color: var(--primary); padding: 8px 12px; border-radius: 10px; font-weight: 600; text-decoration: none;
}
.skip-link:focus { top: 12px; }

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--bg3); }
::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--primary); }

/* ===== HEADER (navy, logo + pills) ===== */
.site-header { background: var(--navy); border-bottom: 1px solid rgba(255,255,255,.07); }
.site-header-inner {
    max-width: 1152px; margin: 0 auto; padding: 0 20px; height: 64px;
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.brand { display: flex; align-items: center; min-width: 0; line-height: 0; }
.brand img { height: 32px; width: auto; max-width: 170px; object-fit: contain; }
.brand-text { color: #fff; font-weight: 800; font-size: 1.1rem; letter-spacing: -.01em; white-space: nowrap; line-height: 1; }
.pills { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.pill {
    display: inline-flex; align-items: center; gap: 8px; height: 32px; padding: 0 12px;
    font-size: 12px; font-weight: 600; color: var(--sky); white-space: nowrap; text-decoration: none;
    background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.1); border-radius: 9999px;
    transition: background var(--transition), color var(--transition), border-color var(--transition);
}
a.pill:hover { background: rgba(255,255,255,.12); border-color: rgba(255,255,255,.25); color: #fff; }
.pill:focus-visible { border-radius: 9999px; }
.pill svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.pill-status { color: rgba(255,255,255,.9); }
.status-dot { width: 8px; height: 8px; border-radius: 9999px; background: #22c55e; box-shadow: 0 0 0 3px rgba(34,197,94,.22); }

/* ===== HERO ===== */
.hero {
    position: relative; overflow: hidden; color: #fff;
    background:
        radial-gradient(900px 420px at 85% -10%, rgba(0,165,255,.22), transparent 60%),
        radial-gradient(700px 380px at -10% 110%, rgba(0,83,206,.35), transparent 60%),
        var(--navy);
}
.hero::before {
    content: ''; position: absolute; inset: 0; pointer-events: none;
    background-image:
        linear-gradient(rgba(255,255,255,.045) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,.045) 1px, transparent 1px);
    background-size: 44px 44px;
    -webkit-mask-image: linear-gradient(to bottom, black 30%, transparent 95%);
    mask-image: linear-gradient(to bottom, black 30%, transparent 95%);
}
.hero-inner {
    position: relative; max-width: 1152px; margin: 0 auto; padding: 48px 20px 104px;
    display: grid; gap: 28px; grid-template-columns: 1fr auto; align-items: end;
}
.eyebrow { font-size: 13px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--sky); }
/* "NEW INTERFACE" launch badge (until SUPPORT_NEW_BADGE_UNTIL, see lib/support/new-badge.php) */
.new-badge { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-top: 16px; }
.new-badge-pill {
    display: inline-flex; align-items: center; height: 26px; padding: 0 12px; border-radius: 9999px;
    background: #dc2626; color: #fff; font-size: 12px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase;
    box-shadow: 0 6px 18px -6px rgba(220,38,38,.7), inset 0 0 0 1px rgba(255,255,255,.18);
}
.new-badge-note { color: #e2e8f0; font-size: .95rem; font-weight: 500; }
.hero h1 { margin-top: 10px; font-size: clamp(2.1rem, 5vw, 3rem); line-height: 1.1; font-weight: 800; letter-spacing: -.02em; }
.hero h1 span { color: var(--accent); }
.hero-sub { margin-top: 12px; font-size: 1.05rem; color: #c9d3e3; max-width: 36rem; }

.report-bar {
    display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
    background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.12);
    border-radius: 16px; padding: 10px 10px 10px 14px;
}
.client-label { font-size: .8rem; font-weight: 600; color: var(--sky); white-space: nowrap; }
.report-bar .client-input {
    width: 220px; height: 40px; padding: 0 14px; border-radius: 12px;
    border: 1px solid rgba(255,255,255,.16); background: rgba(8,15,30,.55); color: #fff;
    font-family: var(--font); font-size: .88rem; outline: none; transition: border-color var(--transition), box-shadow var(--transition);
}
.report-bar .client-input::placeholder { color: #8b97ad; }
.report-bar .client-input:focus { border-color: var(--accent); box-shadow: 0 0 0 4px rgba(0,165,255,.18); }
.report-actions { display: flex; align-items: center; gap: 8px; }
.header-time {
    color: #c9d3e3; font-family: var(--mono); font-size: .75rem; font-variant-numeric: tabular-nums;
    padding: 0 10px; height: 40px; display: inline-flex; align-items: center;
    border-radius: 12px; background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.08);
}
.print-btn {
    display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 16px;
    background: var(--primary); border: none; border-radius: 12px; color: #fff; cursor: pointer;
    font-family: var(--font); font-size: .88rem; font-weight: 700;
    box-shadow: 0 10px 24px -10px rgba(0,83,206,.65); transition: background var(--transition), transform var(--transition);
}
.print-btn:hover:not(:disabled) { background: var(--primary-600); transform: translateY(-1px); }
.print-btn:disabled { opacity: .5; cursor: not-allowed; box-shadow: none; }
/* Sits just under the bar so it never widens it. */
.report-bar { position: relative; }
.print-hint { position: absolute; top: 100%; right: 12px; margin: 6px 0 0; text-align: right; font-size: .78rem; color: #9fb0c8; white-space: nowrap; }
.print-hint[hidden] { display: none; }
.print-btn svg { width: 15px; height: 15px; }

/* ===== WORKSPACE (overlaps the hero, like the portal cards) ===== */
.workspace { flex: 1; width: 100%; max-width: 1152px; margin: -64px auto 0; padding: 0 20px; position: relative; }

/* ===== CATEGORY NAV: always ONE row =====
   >= 1200px: all tabs fit and share the spare width evenly.
   Narrower: the row scrolls sideways (snap, edge fades set by app.js). */
.cat-wrap {
    position: relative;
    background: #fff; border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow-lg);
}
.cat-wrap::before, .cat-wrap::after {
    content: ''; position: absolute; top: 1px; bottom: 1px; width: 44px; z-index: 1;
    pointer-events: none; opacity: 0; transition: opacity .15s ease;
}
.cat-wrap::before { left: 1px; border-radius: 17px 0 0 17px; background: linear-gradient(90deg, #fff 25%, rgba(255,255,255,0)); }
.cat-wrap::after { right: 1px; border-radius: 0 17px 17px 0; background: linear-gradient(270deg, #fff 25%, rgba(255,255,255,0)); }
.cat-wrap.fade-l::before, .cat-wrap.fade-r::after { opacity: 1; }
.cat-bar {
    position: relative; display: flex; flex-wrap: nowrap; gap: 4px; padding: 6px;
    overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x proximity; scroll-padding: 0 36px;
    scrollbar-width: none; -webkit-overflow-scrolling: touch;
}
.cat-bar::-webkit-scrollbar { display: none; }
.cat-tab {
    flex: 0 0 auto; scroll-snap-align: start;
    display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 8px 11px; white-space: nowrap;
    font-family: var(--font); font-size: .8rem; font-weight: 600; color: var(--muted);
    background: none; border: 1px solid transparent; border-radius: 12px; cursor: pointer;
    transition: background var(--transition), color var(--transition);
}
.cat-tab:hover { color: var(--ink); background: var(--paper); }
.cat-tab.active { color: #fff; background: var(--primary); box-shadow: 0 8px 18px -10px rgba(0,83,206,.7); }
.cat-tab:focus-visible { border-radius: 12px; }
.cat-tab svg { width: 15px; height: 15px; flex-shrink: 0; }
.cat-count { font-size: .66rem; font-weight: 700; padding: 1px 6px; border-radius: 9999px; background: var(--bg4); color: var(--muted); }
.cat-tab.active .cat-count { background: rgba(255,255,255,.2); color: #fff; }
@media (min-width: 1200px) {
    .cat-tab { flex: 1 1 auto; padding: 8px 9px; gap: 5px; font-size: .78rem; }
}

/* ===== MAIN ===== */
.main { padding: 24px 0 8px; }

/* ===== TOOL GRID ===== */
.tool-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.tool-card {
    display: block; width: 100%; text-align: left; font: inherit; color: inherit;
    background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
    padding: 20px; cursor: pointer; box-shadow: var(--shadow);
    transition: transform .2s, box-shadow .2s, border-color .2s;
}
.tool-card:hover { transform: translateY(-2px); border-color: #b9cbe6; box-shadow: var(--shadow-lg); }
.tool-card:focus-visible { border-radius: var(--radius); }
.tool-card-icon {
    width: 44px; height: 44px; margin-bottom: 14px; border-radius: 14px;
    background: var(--blue-light); color: var(--primary);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.15rem; font-weight: 700; font-family: var(--mono);
}
.tool-card-name { display: block; font-size: .98rem; font-weight: 700; color: var(--ink); margin-bottom: 4px; letter-spacing: -.005em; }
.tool-card-desc { display: block; font-size: .84rem; color: var(--muted); line-height: 1.5; }

/* ===== TOOL VIEW (one white card) ===== */
.tool-view {
    background: #fff; border: 1px solid var(--line); border-radius: 22px; box-shadow: var(--shadow-lg);
    padding: 24px 28px 28px; animation: fadeIn .2s ease;
}
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.back-btn {
    display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; margin-bottom: 18px;
    background: var(--paper); border: 1px solid var(--line); border-radius: 9999px;
    color: var(--muted); font-family: var(--font); font-size: .82rem; font-weight: 600; cursor: pointer;
    transition: color var(--transition), border-color var(--transition), background var(--transition);
}
.back-btn:hover { color: var(--primary); border-color: #b9cbe6; background: var(--blue-light); }
.back-btn:focus-visible { border-radius: 9999px; }

.tool-header { margin-bottom: 22px; padding-bottom: 18px; border-bottom: 1px solid #eef2f7; }
.tool-title { font-size: 1.45rem; font-weight: 800; letter-spacing: -.015em; display: flex; align-items: center; gap: 12px; margin-bottom: 4px; }
.tool-title .icon {
    width: 40px; height: 40px; border-radius: 12px; background: var(--blue-light); color: var(--primary);
    display: inline-flex; align-items: center; justify-content: center; font-size: 1.05rem; font-family: var(--mono); flex-shrink: 0;
}
.tool-title .name { color: var(--ink); }
.tool-desc { color: var(--muted); font-size: .92rem; }

/* ===== FORMS ===== */
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: .85rem; font-weight: 600; color: var(--ink); margin-bottom: 6px; }
input[type="text"], input[type="number"], input[type="url"], input[type="password"], select, textarea {
    width: 100%; padding: 11px 14px; background: #fff; border: 1.5px solid var(--line);
    border-radius: var(--radius-sm); color: var(--ink); font-family: var(--font); font-size: .95rem;
    transition: border-color var(--transition), box-shadow var(--transition); outline: none;
}
input::placeholder, textarea::placeholder { color: var(--text3); }
input:focus, select:focus, textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 4px rgba(0,83,206,.15); }
select {
    appearance: none; -webkit-appearance: none; cursor: pointer; padding-right: 38px;
    background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1.5l5 5 5-5' stroke='%234b5568' stroke-width='1.8' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 14px center;
}
input[type="color"] { height: 44px; border: 1.5px solid var(--line); border-radius: var(--radius-sm); background: #fff; padding: 4px; cursor: pointer; }
input[type="range"] { accent-color: var(--primary); }
textarea { min-height: 120px; resize: vertical; font-family: var(--mono); font-size: .84rem; line-height: 1.6; }
.input-row { display: flex; gap: 10px; align-items: flex-end; }
.input-row > * { flex: 1; }
.input-row > .btn { flex: 0 0 auto; height: 46px; }
.input-hint { font-size: .78rem; color: var(--muted); margin-top: 5px; }
.checkbox-row { display: flex; flex-wrap: wrap; gap: 14px; }
.checkbox-row label { display: inline-flex; align-items: center; gap: 6px; font-size: .88rem; font-weight: 500; color: var(--muted); cursor: pointer; }
.checkbox-row input[type="checkbox"], input[type="checkbox"], input[type="radio"] { accent-color: var(--primary); width: 16px; height: 16px; }

/* ===== BUTTONS ===== */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px; white-space: nowrap;
    padding: 11px 20px; border: none; border-radius: var(--radius-sm); cursor: pointer;
    font-family: var(--font); font-size: .9rem; font-weight: 700;
    transition: background var(--transition), transform var(--transition), box-shadow var(--transition), border-color var(--transition), color var(--transition);
}
.btn-primary { background: var(--primary); color: #fff; box-shadow: 0 10px 24px -12px rgba(0,83,206,.65); }
.btn-primary:hover { background: var(--primary-600); transform: translateY(-1px); }
.btn-primary:disabled { opacity: .55; cursor: not-allowed; transform: none; box-shadow: none; }
.btn-secondary { background: #fff; color: var(--primary); border: 1.5px solid var(--line); }
.btn-secondary:hover { background: #eef4ff; border-color: #b9cbe6; }
.btn-danger { background: var(--red-bg); color: var(--red); border: 1px solid #f6c7c7; }
.btn-danger:hover { background: #fbdcdc; }
.btn-sm { padding: 6px 12px; font-size: .8rem; border-radius: 10px; }
.btn-group { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.btn-copy {
    background: #fff; border: 1px solid var(--line); color: var(--muted);
    padding: 4px 10px; font-size: .75rem; font-weight: 600; border-radius: 9999px; cursor: pointer;
    font-family: var(--font); transition: color var(--transition), border-color var(--transition), background var(--transition);
}
.btn-copy:hover { border-color: #b9cbe6; color: var(--primary); background: var(--blue-light); }

/* ===== RESULTS ===== */
.result-box {
    position: relative; margin-top: 14px; padding: 18px; max-height: 500px; overflow-y: auto;
    background: var(--paper); border: 1px solid var(--line); border-radius: 14px;
    font-family: var(--mono); font-size: .82rem; line-height: 1.8; word-break: break-all;
}
.result-box pre { white-space: pre-wrap; word-break: break-all; margin: 0; color: var(--ink); }
.result-box .copy-float { position: absolute; top: 10px; right: 10px; }

/* KV Grid */
.kv-grid {
    display: grid; grid-template-columns: 170px 1fr; gap: 1px; margin-top: 12px;
    background: var(--line); border: 1px solid var(--line); border-radius: 14px; overflow: hidden;
}
.kv-grid div { padding: 10px 14px; font-size: .85rem; }
.kv-grid .kv-key { background: var(--paper); color: var(--muted); font-weight: 600; }
.kv-grid .kv-val { background: #fff; font-family: var(--mono); word-break: break-all; color: var(--ink); }

/* Tags */
.tag { display: inline-block; padding: 4px 11px; border-radius: 9999px; font-size: .76rem; font-weight: 600; }
.tag-green { background: var(--green-bg); color: var(--green); }
.tag-red { background: var(--red-bg); color: var(--red); }
.tag-blue { background: var(--blue-light); color: var(--primary); }
.tag-yellow { background: var(--yellow-bg); color: var(--yellow); }
.tag-cyan { background: var(--cyan-bg); color: var(--cyan); }
.tag-purple { background: #f3f0ff; color: var(--purple); }

/* Info Cards */
.info-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; margin-top: 14px; }
.info-card { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; box-shadow: var(--shadow); }
.info-card .ic-label { font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-bottom: 4px; font-weight: 700; }
.info-card .ic-value { font-size: .95rem; font-weight: 600; font-family: var(--mono); word-break: break-all; color: var(--ink); }

/* Tables */
table.data-table { width: 100%; border-collapse: separate; border-spacing: 0; margin-top: 12px; font-size: .82rem; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.data-table th, .data-table td { padding: 10px 14px; text-align: left; border-bottom: 1px solid var(--line); }
.data-table tr:last-child td { border-bottom: none; }
.data-table th {
    background: var(--paper); color: var(--muted); font-weight: 700; font-size: .72rem;
    text-transform: uppercase; letter-spacing: .06em; position: sticky; top: 0;
}
.data-table td { background: #fff; font-family: var(--mono); }
.data-table tr:hover td { background: var(--blue-light); }

/* Speed Test */
.speed-display { text-align: center; padding: 36px 16px; }
.speed-number { font-size: 4.5rem; font-weight: 700; color: var(--primary); font-family: var(--mono); line-height: 1; }
.speed-unit { font-size: .95rem; color: var(--muted); margin-top: 4px; }
.speed-stats { display: flex; justify-content: center; gap: 40px; margin-top: 28px; flex-wrap: wrap; }
.speed-stat { text-align: center; }
.speed-stat .val { font-size: 1.4rem; font-weight: 700; font-family: var(--mono); }
.speed-stat .lbl { font-size: .75rem; color: var(--muted); margin-top: 2px; }
.speed-phase { font-size: .88rem; color: var(--muted); margin: 10px 0; min-height: 1.2em; }
.speed-conn-info {
    margin: 24px auto 0; padding: 18px 22px; max-width: 480px; text-align: left;
    background: var(--paper); border: 1px solid var(--line); border-radius: 14px;
}
.conn-row { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-bottom: 1px solid var(--line); font-size: .86rem; }
.conn-row:last-child { border-bottom: none; }
.conn-label { color: var(--muted); font-weight: 500; }
.conn-val { color: var(--ink); font-family: var(--mono); font-size: .82rem; text-align: right; }

/* Loading */
.spinner { width: 18px; height: 18px; border: 2.5px solid var(--line); border-top-color: var(--primary); border-radius: 50%; animation: spin .6s linear infinite; display: inline-block; vertical-align: middle; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading-bar { height: 4px; background: var(--bg4); border-radius: 9999px; overflow: hidden; margin: 12px 0; }
.loading-bar-fill { height: 100%; width: 0; background: linear-gradient(90deg, var(--primary), var(--accent)); border-radius: 9999px; transition: width .3s; }
.loading-msg { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: .9rem; padding: 12px 0; }

.port-open { color: var(--green); font-weight: 600; }
.port-closed { color: var(--red); }

/* Inner Tabs */
.inner-tabs { display: flex; gap: 6px; margin-bottom: 14px; flex-wrap: wrap; }
.inner-tab {
    padding: 7px 15px; background: #fff; border: 1px solid var(--line); border-radius: 9999px; cursor: pointer;
    font-size: .82rem; font-weight: 600; font-family: var(--font); color: var(--muted); transition: all var(--transition);
}
.inner-tab:hover { color: var(--ink); border-color: var(--border2); }
.inner-tab.active { background: var(--primary); color: #fff; border-color: var(--primary); }

/* Terminal */
.terminal {
    margin-top: 14px; padding: 18px; max-height: 500px; overflow-y: auto;
    background: var(--navy); border: 1px solid var(--navy-2); border-radius: 14px;
    font-family: var(--mono); font-size: .8rem; line-height: 1.7; white-space: pre-wrap; word-break: break-all; color: #4ade80;
}
.terminal .cmd { color: var(--sky); }
.terminal .err { color: #f87171; }

/* Toast */
.toast {
    position: fixed; bottom: 20px; right: 20px; z-index: 999;
    display: flex; align-items: center; gap: 8px; padding: 12px 18px;
    background: #fff; color: var(--ink); border: 1px solid var(--line); border-radius: 14px; font-size: .86rem; font-weight: 600;
    box-shadow: var(--shadow-lg); animation: slideUp .25s ease;
}
@keyframes slideUp { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }

/* ===== FOOTER (navy, same as the Support Hub) ===== */
.site-footer { background: var(--navy); color: #c9d3e3; margin-top: 64px; }
.site-footer-inner { max-width: 1152px; margin: 0 auto; padding: 0 20px; }
.help-row { display: grid; gap: 16px; padding: 32px 0; grid-template-columns: 1fr 19rem 19rem; align-items: center; }
.help-text h2 { color: #fff; font-size: 1rem; font-weight: 600; }
.help-text p { margin-top: 4px; font-size: .875rem; color: #9aa7bd; }
.contact-pill {
    display: flex; align-items: center; gap: 12px; height: 56px; padding: 0 20px 0 8px; min-width: 0;
    border-radius: 9999px; background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.12);
    text-decoration: none; transition: background var(--transition), border-color var(--transition);
}
.contact-pill:hover { background: rgba(255,255,255,.1); border-color: rgba(255,255,255,.25); }
.contact-pill:focus-visible { border-radius: 9999px; }
.contact-icon { width: 40px; height: 40px; flex-shrink: 0; border-radius: 9999px; color: #fff; display: flex; align-items: center; justify-content: center; }
.contact-icon.wa { background: #25D366; }
.contact-icon.wa svg { width: 18px; height: 18px; }
.contact-icon.mail { background: var(--primary); }
.contact-icon.mail svg { width: 16px; height: 16px; }
.contact-text { line-height: 1.25; min-width: 0; }
.contact-title { display: block; color: #fff; font-weight: 600; font-size: .95rem; }
.contact-sub { display: block; color: var(--sky); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-variant-numeric: tabular-nums; }
.footer-bottom {
    display: flex; align-items: center; justify-content: space-between; gap: 8px 16px; flex-wrap: wrap;
    padding: 16px 0; border-top: 1px solid rgba(255,255,255,.1); font-size: 12px; color: #9aa7bd;
}
.footer-bottom nav { display: flex; flex-wrap: wrap; gap: 6px 20px; }
.footer-bottom a { color: #9aa7bd; text-decoration: none; text-underline-offset: 4px; }
.footer-bottom a:hover { color: #fff; text-decoration: underline; }

/* ===== PRINTED REPORT =====
   Print shows only #printReport (filled by app.js): Letter, 0.6in margins,
   letterhead, details, Input, Results, footer on every page. */
.print-report, .rpt-fallback-footer { display: none; }

@page {
    size: letter;
    margin: 0.6in 0.6in 0.8in;
    @bottom-left {
        content: "Alpha IT Services, LLC | Confidential";
        font-family: 'Plus Jakarta Sans', sans-serif; font-size: 7.5pt; color: #4b5568;
        vertical-align: top; padding-top: 10pt; border-top: 0.75pt solid #dbe3ef;
    }
    @bottom-right {
        content: "Page " counter(page) " of " counter(pages);
        font-family: 'Plus Jakarta Sans', sans-serif; font-size: 7.5pt; color: #4b5568;
        vertical-align: top; padding-top: 10pt; border-top: 0.75pt solid #dbe3ef;
    }
}

@media print {
    html, body { background: #fff !important; }
    body { display: block; min-height: 0; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
    body > *:not(.print-report) { display: none !important; }

    .print-report { display: block; font-family: var(--font); color: #0b1324; font-size: 9.5pt; line-height: 1.45; }

    /* Letterhead */
    .rpt-letterhead { display: flex; align-items: center; justify-content: space-between; gap: 24pt; padding-bottom: 10pt; border-bottom: 1.5pt solid #0053CE; }
    .rpt-letterhead img { height: 26pt; width: auto; }
    .rpt-company { display: flex; flex-direction: column; text-align: right; font-size: 8pt; line-height: 1.45; color: #4b5568; }
    .rpt-company strong { font-size: 10.5pt; font-weight: 800; color: #0b1324; }

    /* Report block */
    .rpt-title { margin: 16pt 0 8pt; font-size: 18pt; font-weight: 800; letter-spacing: -0.01em; color: #0b1324; }
    .rpt-details { width: 100%; border-collapse: collapse; font-size: 9pt; break-inside: avoid; }
    .rpt-details th, .rpt-details td { padding: 4.5pt 8pt; border: 0.75pt solid #dbe3ef; text-align: left; vertical-align: top; }
    .rpt-details th { width: 26%; font-weight: 600; color: #4b5568; background: #f4f7fb; }
    .rpt-details td { font-weight: 600; }

    .rpt-tool { margin-top: 18pt; break-after: avoid; }
    .rpt-tool h2 { font-size: 13pt; font-weight: 800; color: #0b1324; }
    .rpt-tool p { margin-top: 2pt; color: #4b5568; }
    .rpt-section { margin-top: 14pt; }
    .rpt-h {
        margin-bottom: 6pt; padding-bottom: 3pt; border-bottom: 0.75pt solid #dbe3ef;
        font-size: 8pt; font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase; color: #0053CE; break-after: avoid;
    }
    .rpt-line { margin: 2pt 0; break-inside: avoid; }
    .rpt-k { font-weight: 600; color: #4b5568; }
    .rpt-val { font-family: var(--mono); font-size: 8.5pt; word-break: break-word; }
    .rpt-note { margin-top: 2pt; font-size: 7.5pt; color: #4b5568; font-style: italic; }
    .rpt-empty { padding: 10pt 12pt; border: 0.75pt dashed #c4d1e3; border-radius: 4pt; color: #4b5568; font-style: italic; }
    .rpt-fallback-footer { margin-top: 18pt; padding-top: 6pt; border-top: 0.75pt solid #dbe3ef; font-size: 7.5pt; color: #4b5568; }
    .no-margin-boxes .rpt-fallback-footer { display: block; }

    /* Results: plain, ink-friendly versions of the on-screen widgets */
    .rpt-result { margin: 6pt 0 10pt; }
    .rpt-result > * + * { margin-top: 6pt; }
    .rpt-pre, .print-report .result-box, .print-report pre {
        margin: 0; padding: 6pt 8pt; max-height: none; overflow: visible;
        font-family: var(--mono); font-size: 8pt; line-height: 1.5; white-space: pre-wrap; word-break: break-all;
        color: #0b1324; background: #f4f7fb; border: 0.75pt solid #dbe3ef; border-radius: 4pt; box-shadow: none;
    }
    .print-report .result-box pre { padding: 0; border: 0; background: none; }
    .rpt-result table { width: 100%; border-collapse: collapse; font-size: 8.5pt; margin: 0; border: 0; border-radius: 0; overflow: visible; }
    .rpt-result table th, .rpt-result table td {
        padding: 3.5pt 6pt; border: 0.75pt solid #dbe3ef; text-align: left; vertical-align: top;
        background: none; position: static; word-break: break-word;
    }
    .rpt-result table th { background: #f4f7fb; color: #4b5568; font-weight: 700; font-size: 7.5pt; text-transform: uppercase; letter-spacing: 0.05em; }
    .rpt-result table td { font-family: var(--mono); font-size: 8pt; }
    .rpt-result table tr:last-child td { border-bottom: 0.75pt solid #dbe3ef; }
    .rpt-result .rpt-kv th { width: 32%; text-transform: none; letter-spacing: 0; font-size: 8.5pt; font-weight: 600; }
    .rpt-result thead { display: table-header-group; }
    .rpt-result tr { break-inside: avoid; }
    .rpt-result .rpt-keep { break-inside: avoid; }
    .print-report .info-card, .print-report .speed-conn-info { box-shadow: none; max-width: none; margin: 0; padding: 0; border: 0; background: none; }
    .print-report .conn-row { padding: 2pt 0; font-size: 8.5pt; }
    .print-report .speed-display { padding: 4pt 0; text-align: left; }
    .print-report .speed-number { font-size: 26pt; }
    .print-report .speed-stats { justify-content: flex-start; gap: 24pt; margin-top: 8pt; }
    .print-report .speed-stat .val { font-size: 12pt; }

    /* Status words: colour plus a symbol and outline, so they still read in grayscale */
    .print-report .tag { padding: 0 4pt; border: 0.75pt solid currentColor; border-radius: 3pt; background: none; font-weight: 700; font-size: 8pt; }
    .print-report .tag-green, .print-report .port-open { color: #15803d; }
    .print-report .tag-red, .print-report .port-closed { color: #b91c1c; }
    .print-report .tag-yellow { color: #a16207; }
    .print-report .tag-green::before, .print-report .port-open::before { content: "\2713\00a0"; }
    .print-report .tag-red::before, .print-report .port-closed::before { content: "\2715\00a0"; }
    .print-report .tag-yellow::before { content: "!\00a0"; }
    .print-report .port-open, .print-report .port-closed { font-weight: 700; }
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1023px) {
    .help-row { grid-template-columns: 1fr 1fr; }
    .help-text { grid-column: 1 / -1; }
}
@media (max-width: 900px) {
    .hero-inner { grid-template-columns: 1fr; align-items: start; }
    .report-bar { width: 100%; }
    .report-bar .client-input { flex: 1; width: auto; min-width: 0; }
}
@media (max-width: 639px) {
    .hide-sm { display: none; }
    .site-header-inner { padding: 0 16px; gap: 8px; }
    .brand img { height: 28px; }
    .pills { gap: 6px; }
    .hero-inner { padding: 36px 16px 92px; gap: 22px; }
    .report-bar { padding: 10px; }
    .client-label { width: 100%; }
    .report-bar .client-input { flex: 1 1 100%; }
    .report-actions { width: 100%; }
    .report-actions .print-btn { flex: 1; justify-content: center; }
    .workspace { padding: 0 16px; }
    .main { padding-top: 16px; }
    .tool-grid { grid-template-columns: 1fr; gap: 12px; }
    .tool-card { display: grid; grid-template-columns: 44px 1fr; column-gap: 14px; padding: 16px; }
    .tool-card-icon { grid-row: span 2; margin-bottom: 0; }
    .tool-view { padding: 18px 16px 20px; border-radius: 18px; }
    .tool-title { font-size: 1.2rem; }
    .input-row { flex-direction: column; align-items: stretch; }
    .input-row > .btn { width: 100%; }
    .kv-grid { grid-template-columns: 1fr; }
    .kv-grid .kv-key { padding-bottom: 2px; }
    .speed-number { font-size: 3rem; }
    .speed-stats { gap: 20px; }
    .info-grid { grid-template-columns: 1fr 1fr; }
    .data-table { display: block; overflow-x: auto; }
    .help-row { grid-template-columns: 1fr; padding: 28px 0; }
    .footer-bottom { flex-direction: column; align-items: flex-start; }
}
@media (max-width: 379px) {
    .pill-status { display: none; }
    .info-grid { grid-template-columns: 1fr; }
    .speed-stats { flex-direction: column; gap: 12px; }
}
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    .tool-view, .toast { animation: none; }
    .tool-card, .btn, .print-btn, .pill, .cat-tab, .contact-pill, .cat-wrap::before, .cat-wrap::after { transition: none; }
    .tool-card:hover, .btn-primary:hover, .print-btn:hover { transform: none; }
}
