* {
    box-sizing: border-box;
}

body {
    font-family: system-ui, sans-serif;
    max-width: 640px;
    margin: 24px auto;
    padding: 0 16px;
    color: #222;
}

h1 {
    font-size: 1.3rem;
}

table {
    border-collapse: collapse;
    width: 100%;
    margin-top: 16px;
}

th, td {
    border: 1px solid #ccc;
    padding: 10px 12px;
    text-align: left;
    word-break: break-word;
}

th {
    width: 40%;
    background: #f2f2f2;
}

.status-online {
    color: #157347;
    font-weight: bold;
}

.status-offline {
    color: #b02a37;
    font-weight: bold;
}

form {
    margin-top: 24px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
    max-width: 320px;
}

label {
    font-size: 0.9rem;
}

input {
    width: 100%;
    padding: 10px;
    font-size: 16px; /* prevents iOS auto-zoom on focus */
}

button {
    width: 100%;
    padding: 12px;
    font-size: 1rem;
    cursor: pointer;
}

.error {
    color: #b02a37;
}

.top-bar {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}

.top-bar a {
    white-space: nowrap;
}

@media (max-width: 480px) {
    body {
        margin: 12px auto;
    }

    table, thead, tbody, tr {
        display: block;
        width: 100%;
    }

    tr {
        margin-bottom: 10px;
    }

    table th {
        display: none;
    }

    table td {
        display: block;
        width: 100%;
        border-top: none;
    }

    table tr td:first-child {
        border-top: 1px solid #ccc;
    }

    table td::before {
        content: attr(data-label);
        display: block;
        font-weight: bold;
        font-size: 0.8rem;
        color: #555;
        margin-bottom: 2px;
    }
}
