:root {
    /* Light theme — the default. */
    --bg: #f5f7fb; --glow: #e7edfb; --panel: #ffffff; --text: #1a2236; --muted: #5b6478;
    --border: #e3e8f0; --accent: #3b5bdb; --accent-ring: rgba(59,91,219,.22);
    --up: #2b9a55; --warn: #b5740b; --down: #e03131; --invalid: #868e96;
    --chip: #f1f4f9; --ring: rgba(16,24,40,.06); --accent-text: #ffffff;
    --shadow: 0 1px 2px rgba(16,24,40,.06), 0 6px 20px rgba(16,24,40,.05);
}
:root[data-theme="dark"] {
    --bg: #0f1220; --glow: #1c2340; --panel: #1a1f33; --text: #e7e9f2; --muted: #9aa0b8;
    --border: #2a3050; --accent: #6c8cff; --accent-ring: rgba(108,140,255,.25);
    --up: #39d98a; --warn: #f5b14c; --down: #ff6b6b; --invalid: #8b93b0;
    --chip: rgba(255,255,255,.04); --ring: rgba(255,255,255,.06); --shadow: none;
    --accent-text: #0f1220;
}
* { box-sizing: border-box; }
body {
    margin: 0; min-height: 100vh; min-height: 100dvh;
    background: radial-gradient(1200px 600px at 50% -10%, var(--glow) 0%, transparent 60%), var(--bg);
    color: var(--text);
    font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    display: flex; justify-content: center; align-items: flex-start;
    transition: background-color .2s ease, color .2s ease;
}
.wrap { width: 100%; max-width: 620px; padding: clamp(1.25rem, 5vw, 3.5rem) 1.25rem 3rem; }
.topbar { display: flex; justify-content: flex-end; margin-bottom: .75rem; }
#theme-toggle {
    display: inline-flex; align-items: center; gap: .4rem; padding: .4rem .75rem;
    border: 1px solid var(--border); border-radius: 999px; background: var(--panel);
    color: var(--muted); font: inherit; font-size: .85rem; cursor: pointer;
    min-height: 44px; box-shadow: var(--shadow); transition: border-color .15s, color .15s;
}
#theme-toggle:hover { border-color: var(--accent); color: var(--text); }
#theme-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
#theme-toggle .icon { font-size: 1rem; line-height: 1; }
h1 { font-size: clamp(1.8rem, 6vw, 2.6rem); line-height: 1.1; margin: 0 0 .5rem; letter-spacing: -.02em; }
h1 .thin { color: var(--muted); font-weight: 400; }
.tagline { color: var(--muted); margin: 0 0 1.75rem; }
form .field { display: flex; gap: .5rem; }
#url {
    flex: 1; min-width: 0; padding: .85rem 1rem; border-radius: 12px;
    border: 1px solid var(--border); background: var(--panel); color: var(--text);
    font-size: 1rem; outline: none; transition: border-color .15s, box-shadow .15s;
}
#url:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring); }
#url:focus-visible, #submit:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
#submit {
    padding: .85rem 1.4rem; min-height: 44px; border: none; border-radius: 12px; background: var(--accent);
    color: var(--accent-text); font-size: 1rem; font-weight: 600; cursor: pointer;
    box-shadow: var(--shadow); transition: filter .15s, opacity .15s;
}
#submit:hover { filter: brightness(1.08); }
#submit:disabled { opacity: .6; cursor: progress; }
.result {
    margin-top: 1.5rem; border: 1px solid var(--border); border-left-width: 5px;
    border-radius: 12px; background: var(--panel); padding: 1.1rem 1.25rem; box-shadow: var(--shadow);
}
.result[data-category="up"] { border-left-color: var(--up); }
.result[data-category="warn"] { border-left-color: var(--warn); }
.result[data-category="down"] { border-left-color: var(--down); }
.result[data-category="invalid"] { border-left-color: var(--invalid); }
.result .headline { font-size: 1.3rem; overflow-wrap: anywhere; font-weight: 700; margin: 0 0 .35rem; display: flex; align-items: center; gap: .5rem; }
.dot { width: 12px; height: 12px; border-radius: 50%; flex: none; box-shadow: 0 0 0 4px var(--ring); }
.result[data-category="up"] .dot { background: var(--up); }
.result[data-category="warn"] .dot { background: var(--warn); }
.result[data-category="down"] .dot { background: var(--down); }
.result[data-category="invalid"] .dot { background: var(--invalid); }
.result .detail { margin: 0; overflow-wrap: anywhere; }
.result .meta { margin: .9rem 0 0; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: .5rem; }
.result .meta li { font-size: .82rem; color: var(--muted); background: var(--chip); border: 1px solid var(--border); border-radius: 999px; padding: .25rem .7rem; }
.result .meta li b { color: var(--text); font-weight: 600; }
footer { margin-top: 2.5rem; color: var(--muted); font-size: .82rem; border-top: 1px solid var(--border); padding-top: 1rem; }
@media (max-width: 460px) { form .field { flex-direction: column; } #submit { width: 100%; } }

/* Visible only to screen readers — used for the input's label. */
.sr-only {
    position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
    overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0;
}
.prose { margin-top: 2.75rem; }
.prose h2 { font-size: 1.25rem; margin: 0 0 .6rem; letter-spacing: -.01em; }
.prose h3 { font-size: 1rem; margin: 1.4rem 0 .35rem; }
.prose p { margin: 0 0 .75rem; color: var(--muted); overflow-wrap: break-word; }
.prose ul { margin: 0 0 .75rem; padding-left: 1.25rem; color: var(--muted); }
.prose li { margin-bottom: .3rem; }
.prose p:last-child, .prose ul:last-child { margin-bottom: 0; }

@media (prefers-reduced-motion: reduce) {
    * { animation-duration: .01ms !important; animation-iteration-count: 1 !important;
        transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
