:root {
    --bg: #f5f7fb;
    --surface: #ffffff;
    --surface-strong: #eef3fb;
    --text: #1f2937;
    --muted: #4b5563;
    --border: #d3dbe8;
    --primary: #1f4ed8;
    --ok: #1f8f4e;
    --risk: #b97400;
    --error: #b42318;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(160deg, #f5f7fb 0%, #eef3fb 100%);
    color: var(--text);
}

.container {
    max-width: 960px;
    margin: 0 auto;
    padding: 24px 16px 40px;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.header-links {
    display: flex;
    gap: 8px;
}

h1,
h2,
p {
    margin-top: 0;
}

.panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 16px;
    margin-bottom: 16px;
}

.latest-update {
    background: var(--surface-strong);
}

.service-list,
.update-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.service-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    padding: 10px 0;
    border-bottom: 1px solid #e5ebf5;
}

.service-item:last-child,
.update-item:last-child {
    border-bottom: none;
}

.service-name {
    font-weight: 600;
}

.status-pill {
    border-radius: 999px;
    font-size: 0.85rem;
    padding: 4px 10px;
    border: 1px solid currentColor;
    font-weight: 600;
}

.status-ok {
    color: var(--ok);
    background: #ecfdf3;
}

.status-risk {
    color: var(--risk);
    background: #fff8e6;
}

.status-error {
    color: var(--error);
    background: #fff0ef;
}

.update-item {
    padding: 10px 0;
    border-bottom: 1px solid #e5ebf5;
}

.update-time {
    color: var(--muted);
    font-size: 0.88rem;
    margin-bottom: 4px;
}

.update-message {
    margin-bottom: 0;
    white-space: pre-wrap;
    line-height: 1.45;
}

.button {
    border: none;
    border-radius: 8px;
    background: var(--primary);
    color: #ffffff;
    padding: 9px 14px;
    font-size: 0.92rem;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
}

.button-subtle {
    background: #ffffff;
    color: var(--primary);
    border: 1px solid #b6c6f0;
}

.button:hover {
    opacity: 0.92;
}

.stacked-form {
    display: grid;
    gap: 10px;
}

label {
    font-weight: 600;
}

input,
select,
textarea {
    width: 100%;
    font: inherit;
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #ffffff;
}

.service-edit-row {
    display: grid;
    grid-template-columns: 1fr 160px;
    gap: 10px;
    align-items: center;
}

.alert {
    border-radius: 8px;
    padding: 10px 12px;
    margin-bottom: 12px;
}

.alert-error {
    border: 1px solid #efb0ad;
    background: #fff1f0;
    color: #8a1f1b;
}

.alert-success {
    border: 1px solid #a7dfba;
    background: #ecfdf3;
    color: #166534;
}

.site-footer {
    margin-top: 8px;
    text-align: center;
    color: var(--muted);
}

.site-footer a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
}

.site-footer a:hover {
    text-decoration: underline;
}

@media (max-width: 680px) {
    .page-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .service-edit-row {
        grid-template-columns: 1fr;
    }
}
