:root {
    --bg: #0f1714;
    --bg-2: #16201c;
    --ink: #e8f0ea;
    --muted: #8fa399;
    --line: rgba(232, 240, 234, 0.1);
    --accent: #c6f34d;
    --accent-ink: #132014;
    --ok: #4ade9b;
    --bad: #ff7a6a;
    --panel: rgba(20, 30, 26, 0.82);
    --shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
    --font: "Instrument Sans", sans-serif;
    --display: "Newsreader", Georgia, serif;
}

* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    min-height: 100%;
}

body {
    font-family: var(--font);
    color: var(--ink);
    background: var(--bg);
    line-height: 1.45;
}

.atmosphere {
    position: fixed;
    inset: 0;
    z-index: -1;
    background:
        radial-gradient(900px 500px at 8% -10%, rgba(198, 243, 77, 0.16), transparent 60%),
        radial-gradient(700px 420px at 100% 0%, rgba(74, 222, 155, 0.12), transparent 55%),
        linear-gradient(160deg, #0c1311 0%, #132019 45%, #101816 100%);
}

.atmosphere::after {
    content: "";
    position: absolute;
    inset: 0;
    opacity: 0.35;
    background-image:
        linear-gradient(rgba(232, 240, 234, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(232, 240, 234, 0.03) 1px, transparent 1px);
    background-size: 42px 42px;
    mask-image: radial-gradient(circle at center, black 35%, transparent 85%);
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

.top {
    display: flex;
    justify-content: space-between;
    gap: 1.5rem;
    align-items: end;
    padding: 2rem clamp(1.25rem, 3vw, 2.5rem) 1rem;
    animation: fade-rise 0.7s ease both;
}

.brand {
    margin: 0;
    font-family: var(--display);
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 600;
    letter-spacing: -0.03em;
    line-height: 1;
}

.tagline {
    margin: 0.35rem 0 0;
    color: var(--muted);
    font-size: 0.95rem;
}

.filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    align-items: center;
}

.filters input,
.filters select,
.filters button {
    font: inherit;
    border-radius: 0.55rem;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.03);
    color: var(--ink);
    padding: 0.7rem 0.85rem;
}

.filters input {
    min-width: min(280px, 70vw);
}

.filters button {
    background: var(--accent);
    color: var(--accent-ink);
    border-color: transparent;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease, filter 0.2s ease;
}

.filters button:hover {
    transform: translateY(-1px);
    filter: brightness(1.05);
}

.stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.85rem;
    padding: 0 clamp(1.25rem, 3vw, 2.5rem) 1.25rem;
}

.stat {
    padding: 1rem 1.1rem;
    border-bottom: 1px solid var(--line);
}

.stat-label {
    display: block;
    color: var(--muted);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.stat-value {
    display: inline-block;
    margin-top: 0.25rem;
    font-family: var(--display);
    font-size: 2rem;
    font-weight: 600;
    opacity: 0;
}

.stat-value.ok { color: var(--ok); }
.stat-value.bad { color: var(--bad); }

.shell {
    display: grid;
    grid-template-columns: minmax(280px, 380px) 1fr;
    gap: 1rem;
    padding: 0 clamp(1.25rem, 3vw, 2.5rem) 2.5rem;
    min-height: 70vh;
}

.list-pane,
.detail-pane {
    background: var(--panel);
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
    backdrop-filter: blur(10px);
    min-height: 60vh;
}

.list-pane {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.list-head {
    padding: 1.1rem 1.2rem 0.8rem;
    border-bottom: 1px solid var(--line);
}

.list-head h1 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.list-head p {
    margin: 0.25rem 0 0;
    color: var(--muted);
    font-size: 0.9rem;
}

.log-list {
    list-style: none;
    margin: 0;
    padding: 0.4rem;
    overflow: auto;
    flex: 1;
}

.log-item {
    display: block;
    text-decoration: none;
    color: inherit;
    padding: 0.85rem 0.9rem;
    border-radius: 0.65rem;
    border: 1px solid transparent;
    transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.log-item:hover {
    background: rgba(198, 243, 77, 0.05);
    transform: translateX(2px);
}

.log-item.is-active {
    background: rgba(198, 243, 77, 0.1);
    border-color: rgba(198, 243, 77, 0.35);
}

.log-item-top {
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.35rem;
    color: var(--muted);
    font-size: 0.78rem;
}

.log-item strong {
    display: block;
    font-weight: 600;
    margin-bottom: 0.2rem;
}

.log-item .meta {
    color: var(--muted);
    font-size: 0.86rem;
}

.status {
    display: inline-flex;
    align-items: center;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-size: 0.7rem;
    font-weight: 700;
}

.status-success { color: var(--ok); }
.status-failed { color: var(--bad); }

.pager {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem 1rem;
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-size: 0.9rem;
}

.pager a {
    color: var(--accent);
}

.detail {
    padding: 1.35rem clamp(1rem, 2vw, 1.6rem) 1.8rem;
}

.detail-header {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: start;
    margin-bottom: 1.25rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--line);
}

.detail-header h2 {
    margin: 0.4rem 0 0;
    font-family: var(--display);
    font-size: clamp(1.5rem, 2.5vw, 2.1rem);
    font-weight: 600;
    letter-spacing: -0.02em;
    line-height: 1.15;
}

.detail-header time,
.muted {
    color: var(--muted);
}

.kv {
    margin: 0;
    display: grid;
    gap: 0.75rem;
}

.kv > div {
    display: grid;
    grid-template-columns: 140px 1fr;
    gap: 0.75rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--line);
}

.kv dt {
    margin: 0;
    color: var(--muted);
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.kv dd {
    margin: 0;
    word-break: break-word;
}

.kv code,
pre code,
code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.86em;
}

.error-row dd {
    color: var(--bad);
}

.files {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
    margin: 1.25rem 0;
}

.files h3,
.bodies h3 {
    margin: 0 0 0.5rem;
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--muted);
    font-weight: 600;
}

.files ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.files li {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.45rem 0;
    border-bottom: 1px solid var(--line);
}

.files span {
    color: var(--muted);
    font-size: 0.85rem;
}

.bodies {
    display: grid;
    gap: 1.25rem;
    margin-top: 1.25rem;
}

.body-block pre,
.text-body {
    margin: 0;
    padding: 0.9rem;
    background: rgba(0, 0, 0, 0.28);
    border: 1px solid var(--line);
    overflow: auto;
    white-space: pre-wrap;
    word-break: break-word;
    max-height: 320px;
    font-size: 0.86rem;
}

.html-preview {
    width: 100%;
    min-height: 280px;
    border: 1px solid var(--line);
    background: #fff;
}

details {
    margin-top: 0.65rem;
}

details summary {
    cursor: pointer;
    color: var(--muted);
}

.empty {
    padding: 2rem 1.25rem;
    color: var(--muted);
}

.empty p {
    margin: 0 0 0.4rem;
}

.detail-empty {
    display: grid;
    place-items: center;
    min-height: 60vh;
}

.pop-in {
    animation: pop-in 0.55s cubic-bezier(0.2, 0.8, 0.2, 1) both;
    animation-delay: var(--delay, 0ms);
}

.fade-rise {
    animation: fade-rise 0.55s ease both;
}

@keyframes pop-in {
    from {
        opacity: 0;
        transform: translateY(10px) scale(0.96);
    }
    to {
        opacity: 1;
        transform: none;
    }
}

@keyframes fade-rise {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: none;
    }
}

@media (max-width: 960px) {
    .top {
        flex-direction: column;
        align-items: stretch;
    }

    .shell {
        grid-template-columns: 1fr;
    }

    .list-pane {
        max-height: 42vh;
    }

    .kv > div {
        grid-template-columns: 1fr;
        gap: 0.25rem;
    }
}

@media (max-width: 640px) {
    .stats {
        grid-template-columns: 1fr;
    }
}
