:root { color-scheme: light dark; --theme-color: #7189d0; }
* { box-sizing: border-box; }
html, body {
    height: 100%;
    height: 100vh;
    overflow: hidden;
}
body {
    margin: 0;
    display: flex;
    flex-direction: column;
    /* white, not the page background: this color is what iOS's canvas-
       propagation paints into the sliver below innerHeight that no real
       element's box can reach (see outerHeight vs innerHeight investigation).
       It should match nav.tabbar, the thing actually adjacent to that sliver. */
    background: white;
    color: black;
    font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
}
.app-shell {
    height: 100%;
    display: flex;
    flex-direction: column;
}
.a2hs-banner {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem 1rem calc(0.85rem + env(safe-area-inset-bottom));
    background: #1f1f1f;
    color: white;
    font-size: 0.85rem;
    box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.25);
}
.a2hs-banner[hidden] {
    display: none;
}
.a2hs-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    color: white;
}
.a2hs-banner p {
    margin: 0;
    flex: 1;
    line-height: 1.3;
}
#a2hs-dismiss {
    flex-shrink: 0;
    background: none;
    border: none;
    color: white;
    font-size: 1.4rem;
    line-height: 1;
    padding: 0.25rem 0.4rem;
    cursor: pointer;
}
.login-screen {
    display: none;
    height: 100%;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 2rem;
    text-align: center;
    background: #f9f9f9;
}
body.logged-out .app-shell {
    display: none;
}
body.logged-out .login-screen {
    display: flex;
}
#login-form {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    width: 100%;
    max-width: 320px;
}
#login-form input[type="text"],
#login-form input[type="password"] {
    font: inherit;
    padding: 0.75rem 1rem;
    border: 1px solid #ccc;
    border-radius: 12px;
    background: white;
    color: black;
}
.login-error {
    color: #d9342b;
    font-size: 0.9rem;
    min-height: 1.2em;
    margin: 0;
}
.topbar {
    position: relative;
    flex-shrink: 0;
    height: calc(36px + env(safe-area-inset-top));
    background: var(--theme-color);
}
.topbar-title {
    position: absolute;
    left: 50%;
    bottom: 5px;
    transform: translateX(-50%);
    background: #6980c2;
    color: white;
    font-weight: 700;
    padding: 0.35rem 1rem;
    border-radius: 999px;
    font-size: 0.9rem;
    white-space: nowrap;
}
main {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
    padding-bottom: calc(84px + env(safe-area-inset-bottom));
    font-size: 1.2rem;
    font-family: "Helvetica Neue Light", Helvetica, Arial, sans-serif;
    color: gray;
}

h1 {
    color: black;
    margin: 0 0 1rem;
    font-size: 1.8rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
}
.logout-btn {
    font: inherit;
    font-weight: 600;
    padding: 0.6rem 1.2rem;
    border: none;
    border-radius: 8px;
    background: #e11d2e;
    color: white;
    cursor: pointer;
}
.verify-btn {
    display: block;
    width: 92%;
    margin: 1.5rem auto 0;
    font: inherit;
    font-size: 1.1rem;
    padding: 0.9rem 1.2rem;
    border: none;
    border-radius: 30px;
    background: var(--theme-color);
    color: white;
    cursor: pointer;
}
.version-info {
    margin-top: auto;
    padding-top: 2rem;
    font-size: 0.8rem;
    color: #888;
}
#view-menu.active,
#view-qrcode.active {
    height: 100%;
    display: flex;
    flex-direction: column;
}
nav.tabbar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 500;
    display: flex;
    border-top: 1px solid #ddd;
    background: white;
    padding-bottom: env(safe-area-inset-bottom);
}
.tab {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
    padding: 1rem 0 1rem;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    font: inherit;
    font-size: 0.7rem;
    color: #888;
}
.tab img {
    height: 22px;
    opacity: 0.55;
}
.tab.active {
    color: #111;
}
.tab.active > span {
    font-weight: bold;
    border-bottom: 2px solid #d9246c;
}
.tab.active img {
    opacity: 1;
}

.split {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    flex-wrap: nowrap;
}

.logos {
    display: flex;
    flex-direction: row;
    justify-content: space-around;
    margin-top: auto;
    padding: 2rem;
}

.org-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: white;
    overflow: hidden;
}

.org-logo img {
    max-width: 65%;
    max-height: 55%;
}

#qrcode-holder {
    text-align: center;
    background-color: white;
}

#qrcode-holder img {
    padding: 5px;
    border-radius: 3px;
    width: 60vw;
}

#profile-suborg:empty {
    display: none;
}

section.view:not(.active) {
    display: none !important;
}
section.view {
    display: flex;
    flex-direction: column;
    flex-wrap: nowrap;
    gap: 5px;
}

#view-card > div:not(:last-child), #view-qrcode > div:not(:last-child) {
    border-bottom: 1px solid #aaa;
    padding-bottom: 5px;
    margin-bottom: 5px;
}

.valid-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #adffba;
    vertical-align: middle;
}
.valid-badge img {
    width: 11px;
    height: 11px;
}
.valid-badge.invalid {
    background: #d9342b;
}
.valid-badge.invalid img {
    filter: brightness(0) invert(1);
}

.photo-wrap {
    position: relative;
    width: 50vw;
    max-width: 50vw;
    margin: 0 auto 2rem;
}

#profile-photo {
    display: block;
    width: 100%;
    height: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: 50%;
    box-shadow: 0 0 18px 6px rgba(113, 137, 208, 0.9), 0 0 45px 18px rgba(113, 137, 208, 0.35);
}

.pulse-badge {
    position: absolute;
    right: -5%;
    bottom: -5%;
    width: 32%;
    aspect-ratio: 1;
}
.pulse-badge-photo {
    position: relative;
    z-index: 1;
    display: block;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    overflow: hidden;
}
.pulse-badge-photo img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scale(1.5);
}
.pulse-ring {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    animation: pulse-ring 1s ease-out infinite;
}
@keyframes pulse-ring {
    0% {
        box-shadow: 0 0 0 0 #d9246c;
    }
    100% {
        box-shadow: 0 0 0 15px rgba(0, 255, 0, 0);
    }
}

.boldtext {
    font-size: 1.3rem;
    color: black;
    font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
    font-weight: bold;
}

.bigtext {
    font-size: 2.2rem;
    color: black;
    font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
    font-weight: bold;
}

.org-images {
    display: flex;
    flex-direction: column;
    flex-wrap: nowrap;
    justify-content: space-around;
    height: 100%;
}

.org-images img {
    height: 40px;
}
