:root {
    color-scheme: dark;
    --bg: #090b10;
    --panel: rgba(20, 24, 34, 0.86);
    --panel-strong: #151a25;
    --border: rgba(255, 255, 255, 0.1);
    --text: #f6f7fb;
    --muted: #9ca5b5;
    --accent: #8dffcf;
    --accent-dark: #062e25;
    --danger: #ff8793;
    --success: #79e9b5;
    --shadow: 0 30px 80px rgba(0, 0, 0, 0.38);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    min-width: 320px;
    min-height: 100vh;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--text);
    background:
        radial-gradient(circle at 13% 8%, rgba(38, 125, 105, 0.24), transparent 30rem),
        radial-gradient(circle at 85% 18%, rgba(74, 91, 185, 0.17), transparent 28rem),
        var(--bg);
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    background-image: linear-gradient(rgba(255,255,255,.025) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.025) 1px, transparent 1px);
    background-size: 44px 44px;
    mask-image: linear-gradient(to bottom, black, transparent 88%);
}

button, input, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .48; }
a { color: inherit; }
code { font-family: "Cascadia Code", "SFMono-Regular", Consolas, monospace; }

.shell { width: min(1160px, calc(100% - 32px)); margin: 0 auto; padding: 72px 0 36px; }
.hero { max-width: 850px; margin-bottom: 38px; }
.eyebrow { margin-bottom: 16px; color: var(--accent); font: 700 12px/1.2 "Cascadia Code", monospace; letter-spacing: .2em; }
h1 { margin: 0; max-width: 830px; font-size: clamp(42px, 7vw, 84px); line-height: .96; letter-spacing: -.055em; }
.hero p { max-width: 720px; margin: 26px 0 0; color: var(--muted); font-size: 18px; line-height: 1.65; }
.hero code { color: var(--accent); }

.panel { position: relative; margin-top: 24px; padding: 30px; border: 1px solid var(--border); border-radius: 24px; background: var(--panel); box-shadow: var(--shadow); backdrop-filter: blur(18px); }
.panel-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 28px; }
.panel-heading > div:first-child { display: flex; align-items: center; gap: 14px; }
.step { display: grid; place-items: center; width: 38px; height: 38px; flex: 0 0 auto; border: 1px solid rgba(141,255,207,.35); border-radius: 50%; color: var(--accent); font: 700 12px/1 monospace; }
h2, h3 { margin: 0; }
h2 { font-size: 24px; letter-spacing: -.025em; }
h3 { font-size: 17px; }
.hint { color: var(--muted); font-size: 13px; }

label { display: block; margin-bottom: 10px; color: #d9deea; font-size: 14px; font-weight: 650; }
textarea, input { width: 100%; border: 1px solid var(--border); border-radius: 15px; outline: none; color: var(--text); background: rgba(4, 6, 10, .67); transition: border-color .2s, box-shadow .2s; }
textarea { min-height: 210px; padding: 17px 18px; resize: vertical; font-family: "Cascadia Code", "SFMono-Regular", Consolas, monospace; font-size: 14px; line-height: 1.65; }
input { height: 52px; padding: 0 16px; }
textarea:focus, input:focus { border-color: rgba(141,255,207,.65); box-shadow: 0 0 0 4px rgba(141,255,207,.08); }
textarea::placeholder, input::placeholder { color: #5f6877; }
.form-row { display: grid; grid-template-columns: minmax(190px, .8fr) minmax(240px, 1fr) auto; align-items: end; gap: 18px; margin-top: 20px; }
.input-prefix { display: flex; align-items: center; border: 1px solid var(--border); border-radius: 15px; background: rgba(4, 6, 10, .67); overflow: hidden; }
.input-prefix:focus-within { border-color: rgba(141,255,207,.65); box-shadow: 0 0 0 4px rgba(141,255,207,.08); }
.input-prefix span { padding-left: 16px; color: var(--accent); font-family: monospace; }
.input-prefix input { border: 0; border-radius: 0; background: transparent; box-shadow: none; }

button { min-height: 52px; border: 0; border-radius: 14px; padding: 0 24px; font-weight: 750; }
#submit-button { min-width: 220px; color: #07120f; background: var(--accent); transition: transform .18s, filter .18s; }
#submit-button:hover:not(:disabled) { transform: translateY(-2px); filter: brightness(1.06); }
.spinner { display: none; width: 18px; height: 18px; margin: auto; border: 2px solid rgba(0,0,0,.25); border-top-color: #06120e; border-radius: 50%; animation: spin .7s linear infinite; }
.loading .button-label { display: none; }
.loading .spinner { display: block; }
@keyframes spin { to { transform: rotate(360deg); } }


.progress-box {
    margin-top: 20px;
    padding: 17px 18px;
    border: 1px solid rgba(141,255,207,.18);
    border-radius: 15px;
    background: rgba(4, 6, 10, .42);
}
.progress-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 12px;
    font-size: 13px;
}
.progress-heading strong { color: #e8edf5; }
.progress-heading span { color: var(--accent); font-family: "Cascadia Code", monospace; }
.progress-track {
    height: 9px;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(255,255,255,.07);
}
.progress-bar {
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: var(--accent);
    transition: width .25s ease;
}
.progress-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 9px 18px;
    margin-top: 12px;
    color: var(--muted);
    font-size: 12px;
}
.progress-stats strong { color: #e4eaf3; }
.error-report {
    margin-top: 28px;
    padding: 18px;
    border: 1px solid rgba(255,135,147,.22);
    border-radius: 16px;
    background: rgba(115,25,37,.13);
}
.error-list {
    display: grid;
    gap: 10px;
    margin-top: 14px;
}
.error-item {
    padding: 13px 14px;
    border: 1px solid rgba(255,135,147,.17);
    border-radius: 12px;
    background: rgba(4,6,10,.3);
}
.error-item a {
    display: block;
    overflow-wrap: anywhere;
    color: #ffd1d6;
    font-size: 13px;
    text-decoration: none;
}
.error-item a:hover { text-decoration: underline; }
.error-item p {
    margin: 7px 0 0;
    color: var(--danger);
    font-size: 12px;
    line-height: 1.5;
}

.message { margin-top: 18px; padding: 14px 16px; border-radius: 12px; line-height: 1.45; }
.error { border: 1px solid rgba(255,135,147,.25); color: #ffc1c8; background: rgba(115,25,37,.25); }
.results-heading { align-items: center; }
.summary { display: flex; align-items: baseline; gap: 8px; }
.summary strong { color: var(--accent); font-size: 30px; }
.summary span { color: var(--muted); font-size: 13px; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 20px; }
.secondary { min-height: 42px; padding: 0 15px; border: 1px solid var(--border); color: #dfe4ee; background: rgba(255,255,255,.035); font-size: 13px; }
.secondary:hover:not(:disabled) { border-color: rgba(141,255,207,.35); color: var(--accent); }
.table-wrap { overflow: auto; border: 1px solid var(--border); border-radius: 16px; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { padding: 14px 15px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
th { position: sticky; top: 0; color: var(--muted); background: #171c27; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: rgba(255,255,255,.022); }
td:nth-child(1) { width: 54px; color: #697386; }
td:nth-child(2) { min-width: 420px; word-break: break-all; }
td:nth-child(3) { min-width: 340px; word-break: break-all; }
td a { color: #cbd4e2; text-decoration: none; }
td a:hover { color: var(--accent); text-decoration: underline; }
td code { color: var(--accent); }
.empty-state { padding: 34px; border: 1px dashed var(--border); border-radius: 16px; color: var(--muted); text-align: center; }
.page-report { margin-top: 28px; }
.page-list { display: grid; gap: 9px; margin-top: 14px; }
.page-item { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 13px 15px; border: 1px solid var(--border); border-radius: 13px; background: rgba(4,6,10,.34); }
.page-item > div { min-width: 0; }
.page-item span { display: block; margin-top: 5px; color: var(--muted); font-size: 12px; }
.page-url { display: block; overflow: hidden; color: #dce2ed; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; text-decoration: none; }
.page-item strong { flex: 0 0 auto; color: var(--success); font-size: 13px; }
.page-item.error strong, .page-item.error span { color: var(--danger); }
footer { padding: 30px 6px 0; color: #697386; font-size: 12px; line-height: 1.6; }

@media (max-width: 720px) {
    .shell { width: min(100% - 20px, 1160px); padding-top: 42px; }
    .panel { padding: 20px; border-radius: 19px; }
    .panel-heading, .results-heading { align-items: flex-start; flex-direction: column; }
    .form-row { grid-template-columns: 1fr; }
    #submit-button { width: 100%; }
    .hint { display: none; }
    h1 { font-size: clamp(42px, 14vw, 62px); }
    .hero p { font-size: 16px; }
    td:nth-child(2) { min-width: 320px; }
}
