/* ============================================================
   DOMVector — Premium Green Theme | CircularStd | v3
   ============================================================ */

@font-face {
    font-family: 'CircularStd';
    src: url('../fonts/CircularStd-Regular-D_XqMrZX.woff') format('woff');
    font-weight: 400;
    font-display: swap;
}

@font-face {
    font-family: 'CircularStd';
    src: url('../fonts/CircularStd-Medium-DXgNykXS.woff') format('woff');
    font-weight: 500;
    font-display: swap;
}

@font-face {
    font-family: 'CircularStd';
    src: url('../fonts/CircularStd-Bold-DF4DZaMM.woff') format('woff');
    font-weight: 700;
    font-display: swap;
}

:root {
    --bg: #eef4ee;
    --white: #ffffff;
    --off: #f4faf4;
    --g50: #f0fdf4;
    --g100: #dcfce7;
    --g200: #bbf7d0;
    --g400: #4ade80;
    --g500: #22c55e;
    --g600: #16a34a;
    --g700: #15803d;
    --g800: #166534;
    --g900: #0f3d22;
    --ink: #0d1f12;
    --ink2: #334d3a;
    --ink3: #6b8f72;
    --ink4: #a8c9ae;
    --border: rgba(22, 101, 52, .09);
    --bordermd: rgba(22, 101, 52, .16);
    --borderhi: rgba(22, 101, 52, .28);
    --sh: 0 1px 3px rgba(22, 101, 52, .07);
    --shmd: 0 4px 20px rgba(22, 101, 52, .09);
    --shlg: 0 16px 48px rgba(22, 101, 52, .11);
    --shbtn: 0 4px 24px rgba(22, 163, 74, .32);
    --ease: cubic-bezier(.4, 0, .2, 1);
    --dur: .2s;
}

*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'CircularStd', -apple-system, sans-serif;
    background: var(--bg);
    color: var(--ink);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;

    /* subtle grid pattern */
    background-image:
        linear-gradient(rgba(22, 163, 74, .04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(22, 163, 74, .04) 1px, transparent 1px);
    background-size: 40px 40px;
}

/* =========================================================
   HEADER / NAV
   ========================================================= */
.nav {
    width: 100%;
    background: var(--white);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 1px 0 var(--border), 0 4px 20px rgba(22, 101, 52, .05);
}

.nav-inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: .9rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
}

/* Logo */
.logo {
    display: flex;
    align-items: center;
    gap: .65rem;
    text-decoration: none;
}

.logo-mark {
    width: 36px;
    height: 36px;
    background: var(--g600);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    box-shadow: 0 2px 12px rgba(22, 163, 74, .35);
}

.logo-mark::after {
    content: '';
    position: absolute;
    inset: -2px;
    border: 2px solid var(--g400);
    opacity: .35;
}

.logo-mark svg {
    width: 18px;
    height: 18px;
    color: #fff;
}

.logo-text {
    display: flex;
    flex-direction: column;
    gap: .05rem;
}

.logo-name {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--ink);
    letter-spacing: -.03em;
    line-height: 1;
}

.logo-sub {
    font-size: .65rem;
    font-weight: 500;
    color: var(--ink3);
    letter-spacing: .06em;
    text-transform: uppercase;
}

/* Nav links */
.nav-links {
    display: flex;
    align-items: center;
    gap: 1.75rem;
    list-style: none;
}

.nav-links a {
    font-size: .87rem;
    font-weight: 500;
    color: var(--ink3);
    text-decoration: none;
    transition: color var(--dur) var(--ease);
    position: relative;
    padding-bottom: 2px;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--g500);
    opacity: 0;
    transition: opacity var(--dur) var(--ease);
}

.nav-links a:hover {
    color: var(--g700);
}

.nav-links a:hover::after {
    opacity: 1;
}

.nav-badge {
    font-size: .72rem;
    font-weight: 600;
    color: var(--g700);
    background: var(--g50);
    border: 1px solid var(--g200);
    padding: .25rem .9rem;
    letter-spacing: .03em;
    display: flex;
    align-items: center;
    gap: .35rem;
}

.nav-badge::before {
    content: '';
    width: 6px;
    height: 6px;
    background: var(--g500);
    animation: navBlink 2s ease-in-out infinite;
}

/* ── Burger Button ── */
.burger-btn {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 36px;
    height: 36px;
    padding: 6px;
    background: none;
    border: 1px solid var(--g200);
    border-radius: 8px;
    cursor: pointer;
    margin-left: auto;
    transition: background .15s, border-color .15s;
}

.burger-btn:hover {
    background: rgba(34, 197, 94, .1);
}

.burger-bar {
    display: block;
    width: 100%;
    height: 2px;
    background: var(--g700);
    border-radius: 2px;
    transition: transform .25s ease, opacity .2s ease;
}

.burger-btn.open .burger-bar:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.burger-btn.open .burger-bar:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}

.burger-btn.open .burger-bar:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* ── Mobile Menu Drawer ── */
/* ── Mobile Dropdown (top) ── */
.mobile-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--white);
    border-top: 2px solid var(--g100);
    border-bottom: 1px solid var(--g100);
    box-shadow: 0 8px 32px rgba(22, 101, 52, .12);
    z-index: 150;
    overflow: hidden;
    max-height: 0;
    opacity: 0;
    pointer-events: none;
    transition: max-height .3s cubic-bezier(.4, 0, .2, 1), opacity .25s ease;
}

.mobile-dropdown.open {
    max-height: 320px;
    opacity: 1;
    pointer-events: auto;
}

.mobile-dropdown-links {
    list-style: none;
    padding: .5rem 0;
    margin: 0;
}

.mobile-dropdown-links li {
    border-bottom: 1px solid var(--g50);
}

.mobile-dropdown-links li:last-child {
    border-bottom: none;
}

.mobile-dropdown-links li a {
    display: flex;
    align-items: center;
    padding: .85rem 1.5rem;
    font-size: .93rem;
    font-weight: 600;
    color: var(--g800);
    text-decoration: none;
    letter-spacing: .02em;
    transition: background .12s, color .12s, padding-left .15s;
    border-left: 3px solid transparent;
}

.mobile-dropdown-links li a:hover {
    background: var(--g50);
    color: var(--g700);
    padding-left: 1.75rem;
    border-left-color: var(--g400);
}

.mobile-dropdown-footer {
    padding: .65rem 1.5rem;
    background: var(--g50);
    border-top: 1px solid var(--g100);
}

.mobile-dropdown-badge {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    font-size: .72rem;
    font-weight: 600;
    color: var(--g600);
    letter-spacing: .04em;
}

.mobile-dropdown-dot {
    width: 6px;
    height: 6px;
    background: var(--g500);
    border-radius: 50%;
    flex-shrink: 0;
    animation: navBlink 2s ease-in-out infinite;
}

/* ── Overlay backdrop ── */
.mobile-menu-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .2);
    z-index: 149;
    opacity: 0;
    pointer-events: none;
    transition: opacity .25s ease;
}

.mobile-menu-overlay.open {
    opacity: 1;
    pointer-events: auto;
}


@keyframes navBlink {

    0%,
    100% {
        opacity: 1
    }

    50% {
        opacity: .3
    }
}

/* =========================================================
   HERO
   ========================================================= */
.hero {
    max-width: 1100px;
    margin: 0 auto;
    padding: 2.2rem 1.5rem 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    position: relative;
}

/* floating HTML tag decorations */
.hero-tags {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
    opacity: .5;
}

.htag {
    position: absolute;
    font-family: 'SFMono-Regular', monospace;
    font-size: .8rem;
    color: var(--g600);
    border: 1px solid var(--g200);
    background: var(--g50);
    padding: .18rem .55rem;
    white-space: nowrap;
    animation: floatTag 8s ease-in-out infinite;
}

.htag:nth-child(1) {
    top: 12%;
    left: 5%;
    animation-delay: 0s;
    animation-duration: 9s;
}

.htag:nth-child(2) {
    top: 25%;
    right: 4%;
    animation-delay: 1.5s;
    animation-duration: 11s;
}

.htag:nth-child(3) {
    top: 60%;
    left: 2%;
    animation-delay: 3s;
    animation-duration: 8s;
}

.htag:nth-child(4) {
    top: 70%;
    right: 6%;
    animation-delay: 4s;
    animation-duration: 10s;
}

.htag:nth-child(5) {
    top: 45%;
    left: 8%;
    animation-delay: 2s;
    animation-duration: 12s;
}

.htag:nth-child(6) {
    top: 55%;
    right: 3%;
    animation-delay: 5s;
    animation-duration: 9.5s;
}

@keyframes floatTag {

    0%,
    100% {
        transform: translateY(0);
        opacity: .5;
    }

    50% {
        transform: translateY(-10px);
        opacity: 1;
    }
}

.hero-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    background: var(--g50);
    border: 1px solid var(--g200);
    color: var(--g700);
    font-size: .78rem;
    font-weight: 600;
    padding: .3rem 1rem;
    letter-spacing: .04em;
    text-transform: uppercase;
    margin-bottom: 1rem;
    position: relative;
    z-index: 1;
}

.hero-eyebrow svg {
    width: 13px;
    height: 13px;
}

.hero h1 {
    font-weight: 700;
    font-size: clamp(1.8rem, 4vw, 2.8rem);
    color: var(--ink);
    letter-spacing: -.045em;
    line-height: 1.06;
    margin-bottom: .75rem;
    position: relative;
    z-index: 1;
}

.hero h1 em {
    font-style: normal;
    color: var(--g600);
    position: relative;
}

.hero h1 em::after {
    content: '';
    position: absolute;
    bottom: -3px;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--g400), var(--g600));
    opacity: .5;
}

.hero-sub {
    color: var(--ink2);
    font-size: .95rem;
    max-width: 520px;
    line-height: 1.65;
    margin-bottom: 1.2rem;
    position: relative;
    z-index: 1;
}

/* Feature chips */
.feature-chips {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    justify-content: center;
    position: relative;
    z-index: 1;
}

.chip {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    background: var(--white);
    border: 1px solid var(--bordermd);
    color: var(--ink2);
    font-size: .82rem;
    font-weight: 500;
    padding: .35rem .95rem;
    box-shadow: var(--sh);
    transition: all var(--dur) var(--ease);
}

.chip svg {
    width: 14px;
    height: 14px;
    color: var(--g600);
}

.chip:hover {
    background: var(--g50);
    border-color: var(--g200);
    color: var(--g700);
    box-shadow: var(--shmd);
    transform: translateY(-1px);
}

/* =========================================================
   MAIN CONTENT
   ========================================================= */
.main {
    flex: 1;
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 1.5rem 3rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* ── Card ── */
.card {
    background: var(--white);
    border: 1px solid var(--bordermd);
    box-shadow: var(--shmd);
    position: relative;
    overflow: hidden;
}

.card::before {
    display: none;
}

@keyframes cardBar {
    0% {
        background-position: 0% 50%
    }

    100% {
        background-position: 200% 50%
    }
}

.card-body {
    padding: 1.75rem 2rem 1.5rem;
}

/* ── Input ── */
.input-block {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.input-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: .55rem;
}

.input-label {
    display: flex;
    align-items: center;
    gap: .35rem;
    font-size: .74rem;
    font-weight: 600;
    color: var(--ink3);
    text-transform: uppercase;
    letter-spacing: .09em;
}

.input-label svg {
    width: 12px;
    height: 12px;
}

.url-counter {
    font-size: .74rem;
    font-weight: 600;
    color: var(--ink4);
    background: var(--g50);
    border: 1px solid var(--border);
    padding: .18rem .65rem;
    transition: color var(--dur) var(--ease), border-color var(--dur) var(--ease);
}

.url-counter.has-urls {
    color: var(--g600);
    border-color: var(--g200);
}

.url-counter.counter-flash {
    animation: counterFlash .5s ease;
}

@keyframes counterFlash {
    0% {
        background: rgba(34, 197, 94, .25);
        transform: scale(1.08);
    }

    100% {
        background: transparent;
        transform: scale(1);
    }
}

.textArea {
    width: 100%;
    height: 130px;
    background: var(--off);
    border: 1.5px solid var(--bordermd);
    padding: .95rem 1.1rem;
    color: var(--ink);
    font-family: 'CircularStd', sans-serif;
    font-size: .92rem;
    line-height: 1.75;
    resize: vertical;
    outline: none;
    transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}

.textArea:hover {
    border-color: var(--borderhi);
}

.textArea:focus {
    border-color: var(--g500);
    background: var(--white);
    box-shadow: 0 0 0 3px rgba(34, 197, 94, .13);
}

.textArea::placeholder {
    color: var(--ink4);
}

/* ── ECG Strip ── */
.ecg-strip {
    width: 100%;
    height: 52px;
    background-color: var(--g50);
    border: 1.5px solid var(--bordermd);
    border-top: none;
    position: relative;
    overflow: hidden;
    background-image: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' width='500' height='52'><line x1='0' y1='26' x2='500' y2='26' stroke='%2322c55e' stroke-width='1' opacity='0.15'/></svg>");
    background-size: 500px 52px;
    background-repeat: repeat-x;
    transition: filter .3s ease;
}

.ecg-strip.loading {
    background-image: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' width='500' height='52'><path d='M0,26 L130,26 Q145,18 160,26 L180,26 L183,32 L188,1 L193,46 L200,26 L240,26 Q265,14 290,26 L500,26' stroke='%2322c55e' stroke-width='1.8' fill='none'/></svg>");
    animation: ecgScroll 2s linear infinite;
}

@keyframes ecgScroll {
    to {
        background-position: -500px 0;
    }
}

.ecg-strip.pulse {
    filter: brightness(1.9) drop-shadow(0 0 6px #22c55e);
}

.ecg-step-label {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: .7rem;
    font-weight: 600;
    color: var(--g700);
    background: var(--white);
    border: 1px solid var(--g200);
    padding: .15rem .65rem;
    white-space: nowrap;
    opacity: 0;
    transition: opacity .3s ease;
}

.ecg-strip.loading .ecg-step-label {
    opacity: 1;
}

/* ── Live Log ── */
.live-log {
    background: rgba(240, 253, 244, .72);
    backdrop-filter: blur(18px) saturate(1.4);
    -webkit-backdrop-filter: blur(18px) saturate(1.4);
    border: 1.5px solid rgba(34, 197, 94, .18);
    border-radius: 0 0 16px 16px;
    font-family: 'SFMono-Regular', 'Consolas', monospace;
    font-size: .79rem;
    min-height: 80px;
    max-height: 230px;
    overflow-y: auto;
    padding: .85rem 1.1rem;
    display: none;
    flex-direction: column;
    gap: .35rem;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .6),
        0 8px 32px rgba(22, 101, 52, .08);
}

.live-log::-webkit-scrollbar {
    width: 5px;
}

.live-log::-webkit-scrollbar-track {
    background: transparent;
}

.live-log::-webkit-scrollbar-thumb {
    background: rgba(34, 197, 94, .22);
    border-radius: 10px;
}

.log-line {
    display: flex;
    gap: .75rem;
    align-items: baseline;
    padding: .3rem .55rem;
    border-radius: 8px;
    transition: background .15s ease;
    animation: logIn .18s ease both;
}

.log-meta {
    display: contents;
}

.log-line:hover {
    background: rgba(34, 197, 94, .06);
}

@keyframes logIn {
    from {
        opacity: 0;
        transform: translateY(4px);
    }

    to {
        opacity: 1;
        transform: none;
    }
}

.log-time {
    color: #94a3b8;
    flex-shrink: 0;
    min-width: 56px;
    font-size: .72rem;
    letter-spacing: .02em;
}

.log-host {
    color: #15803d;
    flex-shrink: 0;
    min-width: 120px;
    max-width: 160px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 600;
}

.log-msg {
    color: #475569;
    opacity: .85;
}

.log-line.done {
    background: rgba(34, 197, 94, .06);
}

.log-line.done .log-msg {
    color: #16a34a;
    opacity: 1;
    font-weight: 500;
}

.log-line.fail {
    background: rgba(239, 68, 68, .05);
}

.log-line.fail .log-msg {
    color: #dc2626;
    opacity: 1;
    font-weight: 500;
}

.log-line.fail .log-host {
    color: #dc2626;
}

.log-line.info .log-msg {
    color: #0369a1;
    opacity: 1;
}

/* ── Toast Notification ── */
.dv-toast {
    position: fixed;
    top: 5rem;
    right: 1.5rem;
    left: auto;
    z-index: 9999;
    display: flex;
    align-items: center;
    gap: .7rem;
    padding: .8rem 1.3rem .8rem 1.1rem;
    border-radius: 14px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: .86rem;
    font-weight: 500;
    line-height: 1.4;
    max-width: 520px;
    backdrop-filter: blur(20px) saturate(1.6);
    -webkit-backdrop-filter: blur(20px) saturate(1.6);
    animation: dvToastIn .35s cubic-bezier(.21, 1.02, .73, 1) both;
}

.dv-toast-error {
    background: rgba(10, 10, 10, .95);
    border: 1px solid rgba(255, 255, 255, .08);
    color: #fca5a5;
    box-shadow: 0 10px 40px rgba(0, 0, 0, .35);
}

.dv-toast-warning {
    background: rgba(10, 10, 10, .95);
    border: 1px solid rgba(255, 255, 255, .08);
    color: #fde68a;
    box-shadow: 0 10px 40px rgba(0, 0, 0, .35);
}

.dv-toast-success {
    background: rgba(10, 10, 10, .95);
    border: 1px solid rgba(255, 255, 255, .08);
    color: #86efac;
    box-shadow: 0 10px 40px rgba(0, 0, 0, .35);
}

.dv-toast-icon {
    flex-shrink: 0;
    display: flex;
    align-items: center;
}

.dv-toast-error .dv-toast-icon {
    color: #f87171;
}

.dv-toast-warning .dv-toast-icon {
    color: #facc15;
}

.dv-toast-success .dv-toast-icon {
    color: #4ade80;
}

.dv-toast-msg {
    flex: 1;
}

.dv-toast-close {
    background: none;
    border: none;
    font-size: 1.3rem;
    line-height: 1;
    cursor: pointer;
    padding: 0 0 0 .5rem;
    opacity: .45;
    transition: opacity .15s;
    color: inherit;
}

.dv-toast-close:hover {
    opacity: 1;
}

@keyframes dvToastIn {
    from {
        opacity: 0;
        transform: translateX(30px) scale(.95);
    }

    to {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}

.dv-toast-out {
    animation: dvToastOut .3s ease forwards;
}

@keyframes dvToastOut {
    to {
        opacity: 0;
        transform: translateX(30px) scale(.95);
    }
}

/* ── Loading Skeleton ── */
.skeleton-card {
    background: var(--white);
    border: 1.5px solid var(--bordermd);
    border-radius: var(--radius);
    overflow: hidden;
    animation: skeletonFadeIn .4s ease;
}

@keyframes skeletonFadeIn {
    from {
        opacity: 0;
        transform: translateY(12px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.skeleton-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--borderlt);
}

.skeleton-tabs {
    display: flex;
    gap: .5rem;
}

.skeleton-tab {
    width: 60px;
    height: 28px;
    border-radius: 8px;
    background: linear-gradient(90deg, var(--off) 25%, rgba(34, 197, 94, .06) 50%, var(--off) 75%);
    background-size: 300% 100%;
    animation: shimmer 1.8s ease-in-out infinite;
}

.skeleton-body {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: .65rem;
}

.skeleton-bar {
    height: 14px;
    border-radius: 6px;
    background: linear-gradient(90deg, var(--off) 25%, rgba(34, 197, 94, .08) 50%, var(--off) 75%);
    background-size: 300% 100%;
    animation: shimmer 1.8s ease-in-out infinite;
}

.skeleton-w100 {
    width: 100%;
}

.skeleton-w90 {
    width: 90%;
    animation-delay: .05s;
}

.skeleton-w85 {
    width: 85%;
    animation-delay: .1s;
}

.skeleton-w80 {
    width: 80%;
    animation-delay: .15s;
}

.skeleton-w75 {
    width: 75%;
    animation-delay: .2s;
}

.skeleton-w70 {
    width: 70%;
    animation-delay: .25s;
}

.skeleton-w60 {
    width: 60%;
    animation-delay: .3s;
}

.skeleton-w45 {
    width: 45%;
    animation-delay: .35s;
}

.skeleton-w40 {
    width: 40%;
}

@keyframes shimmer {
    0% {
        background-position: 100% 0;
    }

    100% {
        background-position: -100% 0;
    }
}

/* ── Controls ── */
.controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: .75rem;
}

.controls-left {
    display: flex;
    gap: .6rem;
    align-items: center;
}

.controls-right {
    display: flex;
    gap: .6rem;
    align-items: center;
}

/* ── Buttons ── */
.btn {
    font-family: 'CircularStd', sans-serif;
    font-weight: 500;
    font-size: .9rem;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: .42rem;
    padding: .7rem 1.55rem;
    transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease), background var(--dur) var(--ease);
    user-select: none;
}

.btn:active {
    transform: scale(.97) !important;
}

.btn svg {
    flex-shrink: 0;
}

.btnSubmit {
    background: var(--g600);
    color: #fff;
    min-width: 155px;
    box-shadow: var(--shbtn);
    font-weight: 600;
}

.btnSubmit:hover {
    background: var(--g700);
    transform: translateY(-2px);
    box-shadow: 0 8px 28px rgba(22, 163, 74, .4);
}

.btnSubmit:disabled {
    opacity: .4;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none;
}

.btnSecondary {
    background: var(--white);
    color: var(--ink2);
    border: 1px solid var(--bordermd);
    box-shadow: var(--sh);
    padding: .62rem 1.1rem;
}

.btnSecondary:hover {
    background: var(--g50);
    color: var(--g700);
    border-color: var(--borderhi);
    transform: translateY(-1px);
    box-shadow: var(--shmd);
}

.btnSecondary.copied {
    background: var(--g50);
    color: var(--g700);
    border-color: var(--g200);
}

.btnClear {
    font-family: 'CircularStd', sans-serif;
    font-weight: 500;
    font-size: .86rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    padding: .62rem .85rem;
    background: transparent;
    color: var(--ink3);
    border: 1px solid var(--border);
    transition: all var(--dur) var(--ease);
}

.btnClear:hover {
    color: #dc2626;
    border-color: #fca5a5;
    background: #fff5f5;
}

/* ── Failed panel ── */
.failed-panel {
    background: #fff8f8;
    border: 1px solid #fecaca;
    padding: 1.1rem 1.4rem;
    display: flex;
    flex-direction: column;
    gap: .6rem;
}

.failed-heading {
    display: flex;
    align-items: center;
    gap: .42rem;
    font-size: .74rem;
    font-weight: 700;
    color: #dc2626;
    text-transform: uppercase;
    letter-spacing: .08em;
}

.failed-heading svg {
    width: 13px;
    height: 13px;
}

.failed-item {
    display: flex;
    flex-direction: column;
    gap: .18rem;
    padding: .5rem .8rem;
    background: #fff;
    border-left: 3px solid #f87171;
}

.failed-url {
    font-size: .84rem;
    font-weight: 500;
    color: var(--ink);
    word-break: break-all;
}

.failed-reason {
    font-size: .77rem;
    color: #ef4444;
}

/* ── Stats ── */
.stats-row {
    display: flex;
    align-items: center;
    gap: .5rem;
    flex-wrap: wrap;
}

.stat-chip {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    background: var(--white);
    border: 1px solid var(--g200);
    padding: .3rem .9rem;
    font-size: .78rem;
    font-weight: 600;
    color: var(--g700);
    box-shadow: var(--sh);
}

.stat-chip svg {
    width: 12px;
    height: 12px;
}

/* ── Output card ── */
.output-card {
    background: var(--white);
    border: 1px solid var(--bordermd);
    box-shadow: var(--shmd);
}

.output-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: .85rem 1.5rem;
    background: var(--g900);
}

.output-title {
    display: flex;
    align-items: center;
    gap: .5rem;
    font-size: .76rem;
    font-weight: 600;
    color: var(--g200);
    text-transform: uppercase;
    letter-spacing: .09em;
    font-family: 'CircularStd', sans-serif;
}

.output-title svg {
    width: 13px;
    height: 13px;
}

.output-actions {
    display: flex;
    gap: .45rem;
}

.btnOut {
    font-family: 'CircularStd', sans-serif;
    font-size: .77rem;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    background: rgba(255, 255, 255, .07);
    color: #bbf7d0;
    border: 1px solid rgba(255, 255, 255, .12);
    padding: .3rem .85rem;
    cursor: pointer;
    transition: background var(--dur) var(--ease);
}

.btnOut:hover {
    background: rgba(255, 255, 255, .13);
}

.btnOut.copied {
    background: rgba(74, 222, 128, .2);
    color: var(--g200);
    border-color: rgba(74, 222, 128, .35);
}

.btnOut svg {
    width: 12px;
    height: 12px;
}

pre {
    background: #061209;
    padding: 1.5rem 1.6rem;
    min-height: 100px;
    max-height: 580px;
    overflow-y: auto;
    font-family: 'SFMono-Regular', 'Consolas', monospace;
    font-size: .825rem;
    line-height: 1.85;
}

pre::-webkit-scrollbar {
    width: 5px;
}

pre::-webkit-scrollbar-thumb {
    background: rgba(34, 197, 94, .2);
}

.json-key {
    color: #86efac;
    font-weight: 500;
}

.json-value {
    color: #7dd3fc;
}

.json-string {
    color: #fde68a;
}

/* ── Output split pane ── */
.output-body {
    display: flex;
    min-height: 100px;
}

.output-pane {
    flex: 1;
    overflow: auto;
    max-height: 580px;
}

.output-pane+.output-pane {
    border-left: 1px solid rgba(22, 101, 52, .12);
}

/* Tab switcher (inside header) */
.output-tabs {
    display: flex;
    gap: 0;
    margin-right: auto;
    margin-left: 1rem;
}

.output-tab {
    font-family: 'CircularStd', sans-serif;
    font-size: .72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .07em;
    background: rgba(255, 255, 255, .05);
    color: rgba(187, 247, 208, .45);
    border: 1px solid rgba(255, 255, 255, .08);
    border-right: none;
    padding: .3rem .85rem;
    cursor: pointer;
    transition: all .15s ease;
}

.output-tab:last-child {
    border-right: 1px solid rgba(255, 255, 255, .08);
}

.output-tab.active {
    background: rgba(34, 197, 94, .15);
    color: #bbf7d0;
    border-color: rgba(34, 197, 94, .25);
}

.output-tab:hover:not(.active) {
    background: rgba(255, 255, 255, .08);
    color: rgba(187, 247, 208, .7);
}

/* pre inside pane */
.output-pane pre {
    max-height: none;
    min-height: 0;
    height: 100%;
}

/* ── Tree Viewer ── */
.tree-viewer {
    background: #fafef9;
    padding: 1rem 1.25rem;
    font-family: 'SFMono-Regular', 'Consolas', monospace;
    font-size: .82rem;
    line-height: 1.4;
    color: var(--ink);
}

.tree-viewer ul {
    list-style: none;
    padding-left: 1.35rem;
    margin: 0;
    position: relative;
}

.tree-viewer>ul {
    padding-left: 0;
}

/* vertical indent line */
.tree-viewer ul ul::before {
    content: '';
    position: absolute;
    left: .55rem;
    top: 0;
    bottom: .6rem;
    width: 1px;
    background: var(--g200);
}

/* tree node */
.tree-node {
    position: relative;
    padding: 2px 0;
}

/* toggle arrow */
.tree-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    cursor: pointer;
    color: var(--ink3);
    transition: transform .15s ease, color .15s ease;
    flex-shrink: 0;
    vertical-align: middle;
    margin-right: 2px;
}

.tree-toggle:hover {
    color: var(--g600);
}

.tree-toggle.collapsed {
    transform: rotate(-90deg);
}

/* no-toggle spacer for leaf nodes */
.tree-spacer {
    display: inline-block;
    width: 18px;
}

/* icon badges */
.tree-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    font-size: .65rem;
    font-weight: 700;
    margin-right: 4px;
    vertical-align: middle;
}

.tree-icon-obj {
    color: var(--g700);
    background: var(--g100);
    border: 1px solid var(--g200);
}

.tree-icon-arr {
    color: #2563eb;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
}

.tree-icon-str {
    color: #d97706;
    background: #fffbeb;
    border: 1px solid #fde68a;
}

.tree-icon-num {
    color: #7c3aed;
    background: #f5f3ff;
    border: 1px solid #ddd6fe;
}

.tree-icon-bool {
    color: #dc2626;
    background: #fff5f5;
    border: 1px solid #fecaca;
}

.tree-icon-null {
    color: var(--ink3);
    background: var(--off);
    border: 1px solid var(--border);
}

/* key label */
.tree-key {
    font-weight: 600;
    color: var(--ink);
    margin-right: 4px;
}

/* value */
.tree-val {
    color: var(--ink2);
}

.tree-val-str {
    color: #d97706;
}

.tree-val-num {
    color: #7c3aed;
}

.tree-val-bool {
    color: #dc2626;
}

.tree-val-null {
    color: var(--ink3);
    font-style: italic;
}

/* count badge */
.tree-count {
    font-size: .68rem;
    font-weight: 500;
    color: var(--ink3);
    margin-left: 4px;
}

/* hover highlight */
.tree-node>.tree-row:hover {
    background: var(--g50);
    margin: 0 -6px;
    padding: 0 6px;
}

.tree-row {
    display: inline;
}

/* ── Search bar ── */
.table-search-bar {
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: .6rem 1rem;
    background: var(--g50);
    border-bottom: 1px solid var(--border);
}

.table-search-bar svg {
    width: 15px;
    height: 15px;
    color: var(--ink3);
    flex-shrink: 0;
}

.table-search-bar input {
    flex: 1;
    border: 1px solid var(--bordermd);
    background: var(--white);
    color: var(--ink);
    font-family: 'CircularStd', sans-serif;
    font-size: .84rem;
    padding: .4rem .7rem;
    outline: none;
    transition: border-color .15s ease, box-shadow .15s ease;
}

.table-search-bar input:focus {
    border-color: var(--g500);
    box-shadow: 0 0 0 3px rgba(34, 197, 94, .12);
}

.table-search-bar input::placeholder {
    color: var(--ink4);
}

/* ── Tag Table Viewer ── */
.table-viewer {
    background: #fafef9;
    overflow: auto;
    max-height: 540px;
    padding: 0;
}

.tag-table {
    width: 100%;
    border-collapse: collapse;
    font-family: 'SFMono-Regular', 'Consolas', monospace;
    font-size: .82rem;
}

.tag-table thead {
    position: sticky;
    top: 0;
    z-index: 2;
}

.tag-table th {
    background: var(--g800);
    color: var(--g100);
    font-weight: 600;
    font-size: .72rem;
    text-transform: uppercase;
    letter-spacing: .06em;
    padding: .7rem 1rem;
    text-align: center;
    white-space: nowrap;
    border-bottom: none;
}

.tag-table th.tag-table-tag {
    text-align: left;
    min-width: 120px;
    position: sticky;
    left: 0;
    z-index: 3;
    background: var(--g800);
    box-shadow: 2px 0 4px rgba(0, 0, 0, .1);
}

.tag-table td {
    padding: .6rem 1rem;
    text-align: center;
    border-bottom: 1px solid var(--border);
    color: var(--ink);
    transition: background .15s ease;
}

.tag-table td.tag-table-tag {
    text-align: left;
    font-weight: 600;
    color: var(--g700);
    white-space: nowrap;
    position: sticky;
    left: 0;
    z-index: 1;
    background: #fafef9;
    box-shadow: 2px 0 4px rgba(0, 0, 0, .05);
}

.tag-table td.zero {
    color: var(--ink4);
}

.tag-table td.tag-table-total {
    font-weight: 700;
    color: var(--g700);
    background: var(--g50);
    border-left: 2px solid var(--g200);
}

.tag-table tbody tr:nth-child(even) {
    background: var(--g50);
}

.tag-table tbody tr:hover {
    background: var(--g100);
}

/* ── Table Section Headers ── */
.section-header td {
    font-weight: 700;
    font-size: .82rem;
    padding: .55rem 1rem;
    letter-spacing: .04em;
    text-transform: uppercase;
    text-align: left;
    font-family: 'CircularStd', sans-serif;
    border-top: 2px solid var(--g200);
}

.section-header td {
    display: flex;
    align-items: center;
    gap: .45rem;
}

.sec-icon {
    width: 15px;
    height: 15px;
    flex-shrink: 0;
}

.sec-header td {
    background: #e8f4fd !important;
    color: #1a6fa0;
    border-top-color: #bde0f5;
}

.sec-header .sec-icon {
    stroke: #2b8cc4;
}

.sec-content td {
    background: #ecfae5 !important;
    color: #2d6a1e;
    border-top-color: #c2eab4;
}

.sec-content .sec-icon {
    stroke: #3a9e26;
}

.sec-media td {
    background: #f3eafc !important;
    color: #6b2fa0;
    border-top-color: #ddc4f5;
}

.sec-media .sec-icon {
    stroke: #8a45c7;
}

.sec-various td {
    background: #fef5e0 !important;
    color: #966b14;
    border-top-color: #f5dfa0;
}

.sec-various .sec-icon {
    stroke: #c4921e;
}

.section-header:first-child td {
    border-top: none;
}

.section-count {
    font-size: .7rem;
    font-weight: 500;
    color: var(--ink4);
    margin-left: .4rem;
}

/* ── SEO Insights Panel ── */
.seo-panel {
    background: var(--card);
}

.seo-panel-header {
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: .8rem 1.2rem;
    background: var(--g50);
    border-bottom: 1px solid var(--border);
    font-weight: 700;
    font-size: .92rem;
    color: var(--ink);
    font-family: 'CircularStd', sans-serif;
}

.seo-panel-header svg {
    width: 18px;
    height: 18px;
    color: var(--g600);
}

.seo-panel-body {
    padding: 1rem 1.2rem;
}

.seo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1rem;
}

.seo-site-card {
    background: #fafef9;
    border: 1px solid var(--g100);
    padding: 1rem;
}

.seo-site-host {
    font-weight: 700;
    font-size: .85rem;
    color: var(--g700);
    font-family: 'SFMono-Regular', 'Consolas', monospace;
    margin-bottom: .75rem;
    padding-bottom: .5rem;
    border-bottom: 1px solid var(--g100);
}

.seo-section {
    margin-bottom: .75rem;
}

.seo-section:last-child {
    margin-bottom: 0;
}

.seo-section-title {
    font-weight: 600;
    font-size: .75rem;
    color: var(--ink3);
    text-transform: uppercase;
    letter-spacing: .04em;
    margin-bottom: .4rem;
    font-family: 'CircularStd', sans-serif;
}

.seo-schema-list {
    display: flex;
    flex-wrap: wrap;
    gap: .35rem;
}

.seo-schema-badge {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    padding: .25rem .55rem;
    background: var(--g100);
    border: 1px solid var(--g200);
    font-size: .74rem;
    font-weight: 600;
    color: var(--g700);
    font-family: 'CircularStd', sans-serif;
}

.seo-schema-src {
    font-size: .62rem;
    font-weight: 500;
    color: var(--ink4);
    padding: .1rem .3rem;
    background: var(--g50);
}

.seo-none {
    font-size: .78rem;
    color: var(--ink4);
    font-style: italic;
}

.seo-link-stats {
    display: flex;
    flex-direction: column;
    gap: .35rem;
}

.seo-link-row {
    display: grid;
    grid-template-columns: 65px 1fr 35px;
    align-items: center;
    gap: .5rem;
}

.seo-link-label {
    font-size: .74rem;
    font-weight: 600;
    color: var(--ink2);
    font-family: 'CircularStd', sans-serif;
}

.seo-link-bar {
    height: 12px;
    background: var(--g50);
    border-radius: 2px;
    overflow: hidden;
}

.seo-link-fill {
    height: 100%;
    border-radius: 2px;
    transition: width .4s ease;
}

.seo-fill-internal {
    background: #22c55e;
}

.seo-fill-external {
    background: #f59e0b;
}

.seo-fill-nofollow {
    background: #ef4444;
}

.seo-link-num {
    font-size: .74rem;
    font-weight: 700;
    color: var(--ink);
    text-align: right;
    font-family: 'SFMono-Regular', 'Consolas', monospace;
}

/* ── CSV Export Button ── */
.btn-csv-export {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    padding: .35rem .75rem;
    border: 1px solid var(--g500);
    background: transparent;
    color: var(--g700);
    font-family: 'CircularStd', sans-serif;
    font-size: .78rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: all .15s ease;
}

.btn-csv-export svg {
    width: 14px;
    height: 14px;
}

.btn-csv-export:hover {
    background: var(--g500);
    color: #fff;
}

/* ── Chart Viewer ── */
.chart-viewer {
    padding: 1.2rem 1.5rem;
    background: #fafef9;
    max-height: 600px;
    overflow-y: auto;
}

.chart-legend {
    display: flex;
    flex-wrap: wrap;
    gap: .6rem;
    margin-bottom: 1.2rem;
    padding-bottom: .8rem;
    border-bottom: 1px solid var(--border);
}

.chart-legend-item {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    font-size: .78rem;
    color: var(--ink2);
    font-family: 'CircularStd', sans-serif;
}

.chart-legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 2px;
    display: inline-block;
}

.chart-bars {
    display: flex;
    flex-direction: column;
    gap: .45rem;
}

.chart-row {
    display: grid;
    grid-template-columns: 100px 1fr 50px;
    align-items: center;
    gap: .6rem;
}

.chart-label {
    font-family: 'SFMono-Regular', 'Consolas', monospace;
    font-size: .78rem;
    font-weight: 600;
    color: var(--g700);
    text-align: right;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chart-bar-track {
    display: flex;
    height: 24px;
    background: var(--g50);
    border-radius: 3px;
    overflow: hidden;
}

.chart-bar-seg {
    height: 100%;
    animation: chartGrow .5s ease-out forwards;
    transform-origin: left;
}

@keyframes chartGrow {
    from {
        transform: scaleX(0);
    }

    to {
        transform: scaleX(1);
    }
}

.chart-value {
    font-family: 'SFMono-Regular', 'Consolas', monospace;
    font-size: .78rem;
    font-weight: 700;
    color: var(--ink);
    text-align: right;
}

.chart-footer {
    text-align: center;
    padding: .8rem 0 .2rem;
    font-size: .75rem;
    color: var(--ink4);
    font-family: 'CircularStd', sans-serif;
}

/* =========================================================
   FOOTER
   ========================================================= */
footer {
    background: var(--g900);
    color: var(--g100);
    margin-top: auto;
    border-top: 3px solid var(--g700);
}

.footer-top {
    max-width: 1100px;
    margin: 0 auto;
    padding: 3rem 1.5rem 2rem;
    display: grid;
    grid-template-columns: 1.8fr 1fr 1fr 1fr;
    gap: 2.5rem;
}

/* Brand column */
.footer-brand .logo {
    margin-bottom: 1rem;
}

.footer-brand .logo-name {
    color: var(--g200);
}

.footer-brand .logo-sub {
    color: var(--g400);
}

.footer-tagline {
    font-size: .88rem;
    color: rgba(187, 247, 208, .55);
    line-height: 1.65;
    max-width: 280px;
    margin-bottom: 1.25rem;
}

.footer-stat {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    font-size: .78rem;
    font-weight: 500;
    color: var(--g400);
    background: rgba(34, 197, 94, .08);
    border: 1px solid rgba(34, 197, 94, .15);
    padding: .3rem .9rem;
}

.footer-stat svg {
    width: 13px;
    height: 13px;
}

/* Link columns */
.footer-col h4 {
    font-size: .72rem;
    font-weight: 700;
    color: var(--g400);
    text-transform: uppercase;
    letter-spacing: .1em;
    margin-bottom: 1rem;
}

.footer-col ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: .6rem;
}

.footer-col a {
    font-size: .87rem;
    color: rgba(187, 247, 208, .55);
    text-decoration: none;
    transition: color var(--dur) var(--ease);
}

.footer-col a:hover {
    color: var(--g200);
}

/* Bottom bar */
.footer-bottom {
    border-top: 1px solid rgba(34, 197, 94, .12);
}

.footer-bottom-inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: .75rem;
}

.footer-copy {
    font-size: .8rem;
    color: rgba(187, 247, 208, .35);
}

.footer-pills {
    display: flex;
    gap: .5rem;
}

.footer-pill {
    font-size: .7rem;
    font-weight: 600;
    background: rgba(34, 197, 94, .08);
    border: 1px solid rgba(34, 197, 94, .12);
    color: rgba(187, 247, 208, .45);
    padding: .18rem .7rem;
    letter-spacing: .04em;
}

/* =========================================================
   RESPONSIVE
   ========================================================= */
/* ═══════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════ */

/* ── 900px: tablet ── */
@media (max-width: 900px) {
    .nav-links {
        display: none;
    }

    .burger-btn {
        display: flex;
    }

    .nav {
        position: relative;
    }

    .mobile-dropdown {
        display: block;
    }

    .mobile-menu-overlay {
        display: block;
        pointer-events: none;
    }

    .footer-top {
        grid-template-columns: 1fr 1fr;
    }

    .footer-brand {
        grid-column: 1 / -1;
    }

    .hero {
        padding: 2.5rem 1.5rem 1.5rem;
    }

    .htag:nth-child(n+3) {
        display: none;
    }

    .stats-row {
        flex-wrap: wrap;
        gap: .5rem;
    }

    .seo-grid {
        grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    }

    .output-header {
        flex-wrap: wrap;
        gap: .5rem;
        padding: .75rem 1.25rem;
    }

    .output-actions {
        width: 100%;
        justify-content: flex-end;
    }
}

/* ── 640px: mobile ── */
@media (max-width: 640px) {

    /* Nav */
    .nav-inner {
        padding: .75rem 1rem;
    }

    .nav-badge {
        font-size: .72rem;
        padding: .25rem .65rem;
    }

    /* Layout */
    .main {
        padding: 0 .85rem 2rem;
    }

    .card-body {
        padding: 1.1rem 1rem;
    }

    /* Hero */
    .hero {
        padding: 2rem 1rem 1rem;
    }

    .hero h1 {
        font-size: 1.85rem;
        line-height: 1.2;
    }

    .hero-sub {
        font-size: .88rem;
    }

    .feat-pills {
        gap: .4rem;
        flex-wrap: wrap;
        justify-content: center;
    }

    .feat-pill {
        font-size: .73rem;
        padding: .3rem .7rem;
    }

    /* Input block */
    .input-meta {
        flex-wrap: wrap;
        gap: .35rem;
    }

    /* Controls */
    .controls {
        flex-direction: column;
        gap: .6rem;
    }

    .controls-left,
    .controls-right {
        width: 100%;
    }

    .btnSubmit {
        width: 100%;
        justify-content: center;
    }

    .btnSecondary {
        flex: 1;
        justify-content: center;
    }

    /* Stats row */
    .stats-row {
        flex-direction: row;
        flex-wrap: wrap;
        gap: .4rem;
    }

    .stat-chip {
        flex: 1;
        min-width: 0;
        justify-content: center;
        font-size: .75rem;
        padding: .28rem .65rem;
    }

    /* Output header — 2 rows on mobile */
    .output-header {
        flex-wrap: wrap;
        padding: .6rem .85rem .0rem;
        gap: 0;
    }

    .output-title {
        flex: 1;
        font-size: .72rem;
    }

    .output-actions {
        display: flex;
        gap: .35rem;
        align-items: center;
    }

    .btnOut {
        font-size: .7rem;
        padding: .28rem .55rem;
    }

    /* Tabs move below as a full-width scrollable strip */
    .output-tabs {
        order: 3;
        width: calc(100% + 1.7rem);
        margin-left: -.85rem;
        margin-right: -.85rem;
        margin-top: .5rem;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        flex-wrap: nowrap;
        border-top: 1px solid rgba(255, 255, 255, .08);
        padding: 0;
        margin-bottom: 0;
    }

    .output-tabs::-webkit-scrollbar {
        display: none;
    }

    .output-tab {
        flex: 1;
        white-space: nowrap;
        font-size: .7rem;
        padding: .55rem .75rem;
        text-align: center;
        border-top: none;
        border-bottom: none;
        letter-spacing: .05em;
    }

    .output-tab:first-child {
        border-left: none;
    }

    .output-tab:last-child {
        border-right: none;
    }

    /* Tag table — horizontal scroll */
    .tag-table-wrap,
    #tableViewer {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .tag-table {
        min-width: 480px;
    }

    .tag-table th,
    .tag-table td {
        padding: .45rem .6rem;
        font-size: .75rem;
    }

    /* Live log */
    .live-log {
        max-height: 180px;
        font-size: .76rem;
    }

    /* Live log — 2-line stacked */
    .live-log {
        max-height: 200px;
        font-size: .76rem;
    }

    .log-line {
        flex-direction: column;
        gap: .15rem;
        align-items: flex-start;
        padding: .45rem .6rem;
        border-bottom: 1px solid rgba(34, 197, 94, .07);
        border-radius: 0;
    }

    .log-line:last-child {
        border-bottom: none;
    }

    .log-meta {
        display: flex;
        align-items: center;
        gap: .4rem;
        width: 100%;
    }

    .log-host {
        font-size: .75rem;
        font-weight: 600;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        max-width: 60%;
    }

    .log-time {
        font-size: .68rem;
        opacity: .55;
        flex-shrink: 0;
    }

    .log-msg {
        font-size: .78rem;
        word-break: break-all;
        overflow-wrap: anywhere;
        padding-left: .1rem;
        line-height: 1.4;
    }

    /* ECG */
    .ecg-wrap {
        padding: .65rem 1rem;
    }

    /* SEO grid */
    .seo-grid {
        grid-template-columns: 1fr;
    }

    /* Tree viewer */
    #treeViewer {
        font-size: .8rem;
        padding: 1rem;
    }

    /* JSON output */
    pre {
        max-height: 260px;
        font-size: .78rem;
    }

    /* Failed panel */
    .failed-panel {
        padding: .75rem 1rem;
    }

    .failed-item {
        flex-direction: column;
        gap: .25rem;
        align-items: flex-start;
    }

    /* Footer */
    .footer-top {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .footer-bottom-inner {
        flex-direction: column;
        gap: .5rem;
        text-align: center;
    }

    /* Toast on mobile */
    .dv-toast {
        top: 4.5rem;
        right: .75rem;
        left: .75rem;
        max-width: none;
    }

    /* Skeleton */
    .skeleton-body {
        padding: 1rem;
    }

    /* Error pages */
    .error-code {
        font-size: 4.5rem;
    }

    .error-title {
        font-size: 1.2rem;
    }
}

/* ── 400px: small phones ── */
@media (max-width: 400px) {
    .hero h1 {
        font-size: 1.55rem;
    }

    .logo-name {
        font-size: .95rem;
    }

    .logo-sub {
        display: none;
    }

    .nav-badge {
        display: none;
    }

    .btnOut span {
        display: none;
    }

    .card-body {
        padding: .85rem .75rem;
    }
}

/* ── Error Pages (404, 500) ── */
.error-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 60vh;
    padding: 3rem 1.5rem;
}

.error-box {
    text-align: center;
    max-width: 440px;
}

.error-code {
    font-size: 6rem;
    font-weight: 800;
    line-height: 1;
    color: #22c55e;
    letter-spacing: -.04em;
    margin-bottom: .5rem;
}

.error-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #14271a;
    margin: 0 0 .75rem;
}

.error-msg {
    color: #5a7d62;
    font-size: .95rem;
    line-height: 1.6;
    margin: 0 0 2rem;
}

.error-btn {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    padding: .7rem 1.5rem;
    border-radius: 10px;
    background: #16a34a;
    color: #fff;
    font-weight: 600;
    font-size: .9rem;
    text-decoration: none;
    transition: background .15s, transform .15s;
}

.error-btn:hover {
    background: #15803d;
    transform: translateY(-1px);
}