:root {
    --bg: #1d241e;
    --panel: #262f27;
    --border: #35422f;
    --text: #d5e6d8;
    --muted: #9ab3a0;
    --accent: #5a8f68;
    --up: #57a05f;
    --degraded: #d3b53e;
    --down: #c25b4e;
    --none: #55605a;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    background: var(--panel);
    border-bottom: 1px solid var(--border);
}

h1 {
    margin: 0;
    font-size: 1.4rem;
    color: var(--accent);
    letter-spacing: 0.03em;
}

#freshness {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: var(--muted);
}

#freshness .dot {
    width: 0.75rem;
    height: 0.75rem;
    border-radius: 50%;
    display: inline-block;
}

.fresh-up .dot {
    background: var(--up);
    box-shadow: 0 0 6px var(--up);
}

.fresh-degraded .dot {
    background: var(--degraded);
    box-shadow: 0 0 6px var(--degraded);
}

.fresh-down .dot {
    background: var(--down);
    box-shadow: 0 0 6px var(--down);
}

main {
    max-width: 60rem;
    margin: 1.5rem auto;
    padding: 0 1.5rem;
}

.opening-message {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1rem 1.25rem;
    margin-bottom: 1rem;
    color: var(--text);
}

.service {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1rem 1.25rem;
    margin-bottom: 1rem;
}

.service-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 0.75rem;
}

.service-status {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    margin-right: 0.5rem;
    font-size: 1.05rem;
    line-height: 1;
}

.proto {
    font-size: 0.95rem;
}

.proto.v4-up,
.proto.v6-up {
    color: var(--up);
}

.proto.v4-down,
.proto.v6-down {
    color: var(--down);
}

.dialog-protos {
    margin-left: 0.4rem;
    white-space: nowrap;
}

.dialog-protos .proto {
    margin-left: 0.15rem;
}

h2 {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 600;
}

.uptime {
    color: var(--muted);
    font-size: 0.9rem;
}

.bars {
    display: flex;
    gap: 2px;
}

.bar {
    flex: 1 1 auto;
    height: 2rem;
    min-width: 3px;
    border-radius: 2px;
    cursor: pointer;
}

.bar.up {
    background: var(--up);
}

.bar.degraded {
    background: var(--degraded);
}

.bar.down {
    background: var(--down);
}

.bar.none {
    background: var(--none);
}

.bar:hover {
    filter: brightness(1.3);
}

footer {
    text-align: center;
    color: var(--muted);
    font-size: 0.85rem;
    padding: 1rem;
}

#bar-dialog {
    position: fixed;
    z-index: 100;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.6rem 0.8rem;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.5);
    font-size: 0.85rem;
    color: var(--text);
    max-width: 22rem;
    pointer-events: none;
}

#bar-dialog .dialog-header {
    font-weight: 600;
    margin-bottom: 0.4rem;
    color: var(--accent);
}

#bar-dialog .dialog-meta {
    color: var(--muted);
    font-size: 0.78rem;
    margin-bottom: 0.4rem;
}

#bar-dialog table {
    border-collapse: collapse;
    width: 100%;
}

#bar-dialog td {
    padding: 0.15rem 0.4rem;
    vertical-align: top;
}

#bar-dialog td.icon {
    width: 1.5rem;
    text-align: center;
}

#bar-dialog .dialog-empty {
    color: var(--muted);
}
