:root {
  color-scheme: light;
  --blue: #3370ff;
  --action: #245bdb;
  --background: #f5f6f7;
  --surface: #fff;
  --text: #1f2329;
  --muted: #646a73;
  --border: #dee0e3;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Segoe UI", sans-serif;
  color: var(--text);
  background: var(--background);
  font-synthesis: none;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
button, input { font: inherit; }
button { touch-action: manipulation; cursor: pointer; -webkit-tap-highlight-color: transparent; }
button:disabled { opacity: .5; cursor: default; }
button:focus-visible, summary:focus-visible, input:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; }
.app { max-width: 430px; min-height: 100vh; min-height: 100dvh; margin-inline: auto; padding-bottom: max(24px, env(safe-area-inset-bottom)); background: var(--surface); }
.topbar { height: calc(52px + env(safe-area-inset-top)); padding: env(safe-area-inset-top) 12px 0 20px; border-bottom: 1px solid var(--background); display: flex; align-items: center; justify-content: space-between; }
h1 { margin: 0; font-size: 18px; line-height: 26px; font-weight: 600; }
h2 { margin: 0; font-size: 18px; line-height: 28px; font-weight: 500; }
.account-menu { position: relative; z-index: 2; }
.account-menu summary { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 8px; cursor: pointer; list-style: none; }
.account-menu summary::-webkit-details-marker { display: none; }
.account-menu summary svg { width: 24px; height: 24px; fill: var(--text); }
.menu-items { position: absolute; right: 0; top: 44px; width: 164px; padding: 4px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); box-shadow: 0 4px 16px #1f232914; }
.menu-items button { width: 100%; min-height: 44px; border: 0; background: transparent; color: var(--text); text-align: left; padding: 10px 12px; font-size: 14px; border-radius: 6px; }
.menu-items button:hover { background: var(--background); }
.auth-view { padding: 48px 24px 24px; }
label { display: block; margin-bottom: 10px; font-size: 16px; }
input:not([type=hidden]) { width: 100%; min-height: 48px; padding: 12px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--text); font-size: 16px; }
form .primary { width: 100%; margin-top: 24px; }
#recovery-form label:not(:first-child) { margin-top: 20px; }
.primary { min-height: 46px; padding: 12px 18px; border: 0; border-radius: 8px; color: white; background: var(--action); font-size: 16px; }
.text-button { min-height: 44px; padding: 10px 14px; border: 0; border-radius: 6px; background: transparent; color: var(--action); font-size: 14px; }
#recovery-toggle { display: block; margin: 12px auto 0; }
.install-help { margin: 12px auto 0; color: var(--muted); font-size: 14px; line-height: 22px; }
.install-help summary { min-height: 44px; padding: 11px; cursor: pointer; text-align: center; list-style: none; }
.install-help summary::-webkit-details-marker { display: none; }
.install-help p { margin: 6px 0; }
@media (display-mode: standalone) { .install-help { display: none; } }
.code-view { padding: 40px 0 24px; text-align: center; }
.code-view h2 { margin: 0 0 20px; }
.qr-stage { position: relative; width: min(80vw, 320px); aspect-ratio: 1; margin-inline: auto; background: var(--surface); }
.qr-image { display: block; width: 100%; height: 100%; object-fit: contain; }
.placeholder { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; }
.placeholder p { margin: 0; padding-inline: 12px; color: var(--muted); font-size: 14px; line-height: 22px; }
.spinner { width: 28px; height: 28px; border: 2px solid var(--border); border-top-color: var(--blue); border-radius: 50%; animation: spin 1s linear infinite; }
.caption { min-height: 20px; margin: 12px 0; line-height: 20px; font-size: 14px; color: var(--muted); font-variant-numeric: tabular-nums; }
.secondary-text { color: var(--muted); }
.error { margin: 12px 20px 0; color: #d92d20; font-size: 14px; line-height: 22px; }
.auth-view .error { margin-inline: 0; }
.demo { margin: 0 0 16px; font-size: 14px; color: var(--muted); }
dialog { width: min(calc(100% - 40px), 350px); padding: 24px; border: 0; border-radius: 12px; color: var(--text); background: var(--surface); }
dialog::backdrop { background: #1f232966; }
dialog p { margin: 12px 0 20px; font-size: 14px; color: var(--muted); line-height: 22px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; }
.dialog-actions .primary { font-size: 14px; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (max-height: 620px) { .code-view { padding-top: 24px; } }
@media (prefers-reduced-motion: reduce) { .spinner { animation: none; } }

/* The campus view follows the reference miniapp; authentication stays compact. */
.app[data-view=code] { background: linear-gradient(180deg, #609af5 0%, #4c88f6 45%, #2b6ef3 100%); }
.campus-view { padding: max(14px, env(safe-area-inset-top)) 24px max(16px, env(safe-area-inset-bottom)); text-align: center; }
.identity-strip { display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 10px 15px; border-radius: 10px; background: #ffffff18; color: white; text-align: left; font-size: 16px; font-weight: 400; }
.identity-strip svg { width: 24px; height: 28px; flex: none; fill: currentColor; }
.campus-card { margin-top: 24px; padding: 24px 0 36px; border-radius: 9px; background: white; }
.scan-instruction { margin: 0 0 10px; color: #151515; font-size: 17px; line-height: 26px; font-weight: 400; }
.campus-card .qr-stage { width: calc(100% - 32px); max-width: 344px; }
.code-note { margin: 8px 0 16px; color: #929292; font-size: 14px; line-height: 20px; }
.campus-badge { margin-inline: 36px; min-height: 39px; display: flex; align-items: center; justify-content: center; border: 1px solid #b4c5d2; border-radius: 24px; background: #3a9cf8; color: white; font-size: 15px; line-height: 22px; }
.campus-footer { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; max-width: 240px; margin: 22px auto 0; color: white; }
.campus-tab { display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 14px; line-height: 20px; }
.campus-tab svg { width: 28px; height: 28px; }
.muted-tab { opacity: .48; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
@media (max-width: 340px) { .campus-view { padding-inline: 20px; } .campus-badge { margin-inline: 28px; } }
@media (max-height: 680px) { .campus-card { margin-top: 18px; padding-top: 18px; padding-bottom: 22px; } .identity-strip { min-height: 46px; } .campus-footer { margin-top: 18px; } }
