* { box-sizing: border-box; margin: 0; padding: 0; }
body {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background: #f4f5f7;
    color: #1f2933;
}
.card {
    max-width: 420px;
    width: 100%;
    background: #fff;
    border-radius: 12px;
    padding: 48px 32px;
    text-align: center;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
}
.brand { font-size: 14px; letter-spacing: 0.12em; text-transform: uppercase; color: #616e7c; margin-bottom: 24px; }
h1 { font-size: 28px; margin-bottom: 12px; }
p { font-size: 16px; line-height: 1.6; color: #52606d; }
.badge {
    display: inline-block;
    margin-top: 28px;
    padding: 6px 14px;
    border-radius: 999px;
    background: #e6f0ff;
    color: #1d4ed8;
    font-size: 13px;
    font-weight: 600;
}

.form { display: flex; flex-direction: column; text-align: left; margin-top: 20px; }
.form label { font-size: 14px; font-weight: 600; margin: 14px 0 6px; }
.form input {
    font: inherit;
    padding: 10px 12px;
    border: 1px solid #cbd2d9;
    border-radius: 8px;
}
.form input:focus { outline: 2px solid #1d4ed8; outline-offset: 1px; border-color: #1d4ed8; }
.form button {
    margin-top: 24px;
    padding: 12px;
    font: inherit;
    font-weight: 600;
    color: #fff;
    background: #1d4ed8;
    border: 0;
    border-radius: 8px;
    cursor: pointer;
}
.form button:hover { background: #1e40af; }

.alert {
    margin-top: 16px;
    padding: 12px;
    border-radius: 8px;
    background: #fdecec;
    color: #9b1c1c;
    font-size: 14px;
    text-align: left;
}

.signout { margin-top: 32px; font-size: 13px; color: #616e7c; display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.link { font: inherit; background: none; border: 0; color: #1d4ed8; cursor: pointer; text-decoration: underline; }

.qr { width: 200px; height: 200px; margin: 20px auto 8px; }
.qr svg { width: 100%; height: 100%; display: block; }
.manual { margin: 8px 0 4px; font-size: 13px; color: #52606d; }
.manual summary { cursor: pointer; }
.manual code, .codes code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    letter-spacing: 0.05em;
}
.manual code { display: block; margin-top: 8px; padding: 8px; background: #f4f5f7; border-radius: 6px; word-break: break-all; }
.codes {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    margin: 20px 0;
    padding: 16px;
    background: #f4f5f7;
    border-radius: 8px;
    font-size: 15px;
}
.button {
    display: block;
    padding: 12px;
    font-weight: 600;
    color: #fff;
    background: #1d4ed8;
    border-radius: 8px;
    text-decoration: none;
}
.button:hover { background: #1e40af; }
.hint { margin-top: 16px; font-size: 13px; }

/* Signed-in layout */
body.app { display: block; padding: 0; }
body.app .card { margin: 32px auto; text-align: left; }
.topbar {
    display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px;
    padding: 14px 24px; background: #fff; border-bottom: 1px solid #e4e7eb;
}
.brand-link { font-size: 14px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: #1f2933; text-decoration: none; }
.topbar nav { display: flex; align-items: center; gap: 18px; font-size: 14px; }
.topbar nav a { color: #1d4ed8; text-decoration: none; }
.topbar nav a:hover, .link:hover { text-decoration: underline; }
.topbar .link { text-decoration: none; font-size: 14px; }
.card.wide { max-width: 960px; padding: 32px; }
@media (max-width: 480px) { .card, .card.wide { padding: 32px 16px; } body.app .card { margin: 16px auto; } }

h2 { font-size: 18px; margin-bottom: 8px; }
.section { margin-top: 36px; }
.section p { font-size: 15px; }
.muted { color: #7b8794; }
.notice {
    margin: 0 0 16px; padding: 12px; border-radius: 8px;
    background: #e3f9e5; color: #0e5a1b; font-size: 14px; text-align: left;
}
.card > .notice, .card > .alert { margin-bottom: 16px; }

.tabs { display: flex; gap: 4px; margin-bottom: 20px; border-bottom: 1px solid #e4e7eb; }
.tabs a { padding: 8px 14px; color: #52606d; text-decoration: none; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs a[aria-current="page"] { color: #1d4ed8; border-bottom-color: #1d4ed8; font-weight: 600; }

.table-wrap { overflow-x: auto; margin-top: 12px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { padding: 10px 8px; text-align: left; border-bottom: 1px solid #e4e7eb; white-space: nowrap; }
th { font-size: 12px; text-transform: uppercase; letter-spacing: 0.05em; color: #616e7c; }
td a { color: #1d4ed8; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13px; }

.pill { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.pill.ok { background: #e3f9e5; color: #0e5a1b; }
.pill.warn { background: #fff3c4; color: #8d6708; }
.pill.bad { background: #fdecec; color: #9b1c1c; }
.pill.muted { background: #eef0f3; color: #616e7c; }

.details { display: grid; grid-template-columns: max-content 1fr; gap: 8px 24px; margin-top: 20px; font-size: 15px; }
.details dt { color: #616e7c; }
@media (max-width: 480px) { .details { grid-template-columns: 1fr; gap: 2px; } .details dd { margin-bottom: 10px; } }

.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.actions button, td button {
    font: inherit; font-size: 14px; font-weight: 600; padding: 8px 14px; border-radius: 8px;
    border: 1px solid #1d4ed8; background: #1d4ed8; color: #fff; cursor: pointer;
}
.actions button.secondary, td button.secondary { background: #fff; color: #1d4ed8; }
.actions button.danger, .form button.danger { background: #b91c1c; border-color: #b91c1c; color: #fff; }
.actions button:hover, td button:hover { filter: brightness(0.92); }
.danger-zone { padding: 20px; border: 1px solid #f5c2c2; border-radius: 10px; }
.danger-zone .form { margin-top: 4px; }

.inline-form { max-width: 420px; }
.form .check { display: flex; gap: 8px; align-items: center; font-weight: 400; }
.form .check input { width: auto; }

.link-box { margin: 20px 0; padding: 20px; border-radius: 10px; background: #e6f0ff; }
.link-box p { font-size: 14px; color: #1f2933; }
.link-box textarea {
    width: 100%; margin-top: 12px; padding: 10px; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 13px; border: 1px solid #b6c7e6; border-radius: 8px; resize: none; background: #fff;
}
.back { margin: 0 0 8px; }
