:root {
    color-scheme: light;
    --bg: #f6f7f4;
    --surface: #ffffff;
    --ink: #151915;
    --muted: #68736a;
    --line: #d8ded7;
    --accent: #1f6f4a;
    --accent-dark: #15523a;
}

* {
    box-sizing: border-box;
}

html,
body {
    min-height: 100%;
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
}

button,
input {
    font: inherit;
}

button {
    min-height: 2.75rem;
    border: 0;
    border-radius: 6px;
    background: var(--accent);
    color: #fff;
    cursor: pointer;
    font-weight: 700;
    padding: 0 1rem;
}

button:hover {
    background: var(--accent-dark);
}

input {
    width: 100%;
    min-height: 2.75rem;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--surface);
    color: var(--ink);
    padding: 0.6rem 0.7rem;
}

input:focus,
button:focus-visible {
    outline: 3px solid rgba(31, 111, 74, 0.24);
    outline-offset: 2px;
}

.pin-entry {
    display: grid;
    min-height: 100vh;
    place-items: center;
    padding: 2rem;
}

.pin-input {
    width: min(88vw, 28rem);
    height: 6.5rem;
    border: 2px solid var(--line);
    border-radius: 8px;
    font-family: Consolas, "Segoe UI Mono", monospace;
    font-size: 4rem;
    font-weight: 700;
    letter-spacing: 0;
    text-align: center;
}

.admin-shell {
    width: min(74rem, calc(100vw - 2rem));
    margin: 0 auto;
    padding: 2rem 0 4rem;
}

.admin-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

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

h1 {
    font-size: 1.75rem;
    margin-bottom: 0.25rem;
}

h2 {
    font-size: 1rem;
    margin-bottom: 1rem;
}

.admin-header p,
.admin-header span {
    color: var(--muted);
    overflow-wrap: anywhere;
}

.admin-panel {
    border-top: 1px solid var(--line);
    padding: 1.25rem 0;
}

.form-grid {
    display: grid;
    gap: 0.85rem;
}

.webhook-grid {
    grid-template-columns: minmax(14rem, 1fr) auto;
    align-items: end;
}

.admin-pin-grid {
    grid-template-columns: repeat(3, minmax(9rem, 1fr)) auto;
    align-items: end;
}

.code-grid {
    grid-template-columns: minmax(12rem, 1fr) minmax(9rem, 0.65fr) repeat(2, minmax(12rem, 1fr)) auto;
    align-items: end;
}

label {
    display: grid;
    color: var(--muted);
    font-size: 0.9rem;
    font-weight: 700;
    gap: 0.35rem;
}

.quiet-button {
    background: transparent;
    border: 1px solid var(--line);
    color: var(--ink);
}

.quiet-button:hover {
    background: #eef2ec;
}

.muted-text {
    color: var(--muted);
}

.status-message {
    background: #e9f4ec;
    border: 1px solid #c8dfcf;
    border-radius: 6px;
    color: #184f36;
    margin-bottom: 1rem;
    padding: 0.75rem 0.9rem;
}

.table-wrap {
    overflow-x: auto;
}

table {
    width: 100%;
    min-width: 48rem;
    border-collapse: collapse;
}

th,
td {
    border-bottom: 1px solid var(--line);
    padding: 0.75rem 0.6rem;
    text-align: left;
}

th {
    color: var(--muted);
    font-size: 0.85rem;
}

.purpose-cell {
    max-width: 16rem;
    overflow-wrap: anywhere;
}

@media (max-width: 760px) {
    .pin-input {
        height: 5.5rem;
        font-size: 3rem;
    }

    .admin-header,
    .admin-pin-grid,
    .webhook-grid,
    .code-grid {
        display: grid;
        grid-template-columns: 1fr;
    }
}