body.paper-theme.gate-body,
body.paper-theme.admin-page:not(.admin-authenticated) {
  background: var(--ui-surface);
  color: var(--ui-text);
  font-family: 'Huninn', 'Helvetica Neue', sans-serif;
  -webkit-font-smoothing: antialiased;
}
.gate-body *, .gate-body *::before, .gate-body *::after { box-sizing: border-box; }
.gate-body [hidden] { display: none !important; }
body.gate-body {
  display: grid;
  grid-template-rows: auto 1fr auto;
  min-height: 100svh;
  min-height: 100dvh;
  margin: 0;
  line-height: 1.6;
}
.gate-body .skip { position: absolute; top: 8px; left: 16px; padding: 10px 14px; transform: translateY(-160%); background: #fff; color: var(--ui-text); }
.gate-body .skip:focus { transform: translateY(0); z-index: 2; }
.entry-header { display: flex; align-items: center; justify-content: space-between; gap: 24px; width: min(100%, 1200px); min-height: 88px; margin: 0 auto; padding: 20px clamp(24px, 5vw, 64px); }
.entry-domain { color: var(--ui-muted); font-size: 13px; text-decoration: none; letter-spacing: .025em; }
.entry-domain, body.admin-page .admin-brand { display: inline-flex; align-items: center; gap: 12px; }
.entry-domain .site-brand-icon, body.admin-page .admin-brand .site-brand-icon { display: block; flex: none; width: 52px; height: 44px; object-fit: contain; }
.gate-body .language-toggle { display: inline-flex; align-items: center; justify-content: center; flex: none; min-width: 44px; min-height: 44px; padding: 8px; border: 1px solid transparent; border-radius: 6px; color: var(--ui-muted); font: 400 13px/1 'Huninn', sans-serif; text-decoration: none; transition: color 180ms ease, background-color 180ms ease; }
.gate-body .language-toggle:hover { color: var(--ui-text); background: var(--ui-soft); }
body.paper-theme .gate-main {
  display: grid;
  align-content: center;
  width: min(calc(100% - 48px), 368px);
  min-width: 0;
  margin: 0 auto;
  padding: 48px 0 72px;
}
body.paper-theme .gate-main .gate-card { width: 100%; margin: 0; padding: 0; border: 0; background: transparent; text-align: left; }
body.paper-theme .gate-main .gate-card h1 {
  margin: 0 0 32px;
  color: var(--ui-text);
  text-align: left;
  font: 400 clamp(28px, 4vw, 34px)/1.4 'Huninn', 'Helvetica Neue', sans-serif;
  letter-spacing: -.03em;
  text-wrap: balance;
}
.gate-body #guest-login { display: flex; flex-direction: column; gap: 24px; margin: 0; padding: 0; }
.gate-body #guest-login > * { flex: none; }
.gate-body .gate-label { display: block; margin: 0; font-size: 14px; color: var(--ui-muted); }
.entry-field { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; min-width: 0; }
.entry-name-field { position: relative; }
body.paper-theme .gate-main .gate-card input,
body.admin-page #login input {
  display: block;
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  min-height: 56px;
  margin: 0;
  padding: 14px 16px;
  border: 1px solid var(--ui-border-strong);
  border-radius: 6px;
  background: #fff;
  color: var(--ui-text);
  font: 400 16px/1.6 'Huninn', 'Helvetica Neue', sans-serif;
  box-shadow: none;
  transition: border-color 180ms ease;
}
.gate-body input::placeholder { color: var(--ui-muted); opacity: .75; }
.gate-body :is(a,button,input):focus-visible,
body.admin-page #login input:focus-visible { outline: 2px solid var(--ui-focus); outline-offset: 4px; }
body.paper-theme .gate-name-hint { margin: 2px 0 0; color: var(--ui-muted); font-size: 13px; line-height: 1.7; }
body.paper-theme .gate-main .gate-card .entry-submit,
body.admin-page #login button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
  min-height: 52px;
  margin: 0;
  padding: 14px 16px;
  border: 1px solid var(--ui-accent);
  border-radius: 6px;
  background: var(--ui-accent);
  color: #fff;
  font: 400 15px/1.5 'Huninn', 'Helvetica Neue', sans-serif;
  letter-spacing: 0;
  cursor: pointer;
  transition: background-color 180ms ease, border-color 180ms ease;
}
.entry-submit svg { display: block; flex: none; width: 18px; height: 18px; }
body.paper-theme .gate-main .gate-card .entry-submit:hover,
body.admin-page #login button:hover { background: var(--ui-text); border-color: var(--ui-text); }
.gate-body .entry-submit:active:not(:disabled) { transform: translateY(1px); }
.gate-body .entry-submit:disabled { opacity: .65; cursor: wait; }
.gate-body #login-status { min-height: 24px; margin: 0; color: var(--ui-muted); font-size: 13px; line-height: 1.7; overflow-wrap: anywhere; }
.gate-body #login-status.error { color: var(--ui-danger); }
.entry-flying-name { position: absolute; inset: 0; display: flex; align-items: center; padding: 14px 16px; pointer-events: none; clip-path: inset(-64px 0 -8px); white-space: pre; font: 400 16px/1.6 'Huninn', 'Helvetica Neue', sans-serif; }
.entry-flying-name > span { display: inline-block; flex: none; }
body.paper-theme .gate-main .entry-departing #guest-name { color: transparent; caret-color: transparent; }
.entry-footer { display: flex; justify-content: center; align-items: center; min-height: 80px; padding: 16px 24px calc(20px + env(safe-area-inset-bottom)); }
body.paper-theme .entry-footer .app-install-link { min-height: 44px; margin: 0; padding: 10px 12px; color: var(--ui-muted); font: 400 13px/1.5 'Huninn', sans-serif; text-decoration: none; border-radius: 6px; }
body.paper-theme .entry-footer .app-install-link:hover { color: var(--ui-text); background: var(--ui-soft); }
.gate-body .noscript-note { margin: 0; padding: 16px 24px; text-align: center; color: var(--ui-muted); font-size: 13px; }
body.admin-page:not(.admin-authenticated) .admin-topbar { min-height: 72px; border: 0; gap: 16px; }
body.admin-page:not(.admin-authenticated) .admin-brand { font: 400 14px/1.5 'Huninn', sans-serif; letter-spacing: 0; }
body.admin-page:not(.admin-authenticated) .admin-back { display: none; }
body.admin-page:not(.admin-authenticated) .language-toggle { margin-left: auto; }
body.admin-page:not(.admin-authenticated) .admin {
  min-height: calc(100svh - 72px);
  min-height: calc(100dvh - 72px);
  display: grid;
  align-items: center;
  padding: 16px 24px 72px;
}
body.admin-page .admin-login-shell { width: min(100%, 380px); margin: 0 auto; }
body.admin-page .admin-login-view { width: 100%; margin: 0; }
body.admin-page .admin-login-view .gate-brand { display: block; width: 44px; height: 44px; margin: 0 0 28px; }
body.admin-page .admin-login-view h1 { margin: 0 0 12px; font: 400 clamp(30px, 5vw, 38px)/1.4 'Huninn', sans-serif; letter-spacing: -.025em; }
body.admin-page .admin-login-view > p { margin: 0 0 28px; font-size: 13px; }
body.admin-page #login { gap: 12px; }
body.admin-page #login label { font-size: 14px; }
body.admin-page #login button { justify-content: center; margin-top: 12px; }
body.admin-page:not(.admin-authenticated) #status { width: 100%; margin: 14px 0 0; overflow-wrap: anywhere; }
body.admin-page.admin-authenticated .admin-login-shell { display: contents; }
@media (max-width: 600px) {
  .entry-header { min-height: 76px; padding: calc(12px + env(safe-area-inset-top)) 24px 12px; }
  body.paper-theme .gate-main { padding: 32px 0 48px; }
  .entry-footer { min-height: 76px; }
}
@media (max-height: 560px) {
  body.paper-theme .gate-main { align-content: start; padding: 24px 0; }
  body.admin-page:not(.admin-authenticated) .admin { align-items: start; padding-top: 24px; }
}
@media (prefers-reduced-motion: reduce) {
  .gate-body *, body.admin-page #login button { transition: none; }
}
