/* Entry screens share the tenant palette and the application's native type. */
.entry-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin-bottom: 38px;
}
.entry-toolbar .home-link,
.entry-toolbar .auth-back {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  margin: 0;
  padding: 0;
  color: var(--ink-2);
  font-size: 0.8125rem;
  text-decoration: none;
}
.entry-theme {
  min-height: 44px;
  padding: 8px 12px;
  border: 1px solid var(--line, var(--rule));
  border-radius: 24px;
  background: var(--card);
  color: var(--ink);
  font: 500 0.8125rem var(--f-body);
  cursor: pointer;
}
.entry-theme span { display: inline-flex; align-items: center; gap: 8px; }
.entry-theme svg { width: 17px; height: 17px; stroke-width: 1.8; }
html[data-theme='light'] .entry-show-light,
html[data-theme='dark'] .entry-show-dark { display: none; }
.entry-theme:hover { border-color: var(--gold-dp); }
.gate {
  min-height: 100dvh;
  padding: clamp(24px, 4vw, 64px);
}
.gate-card {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1fr);
  grid-template-rows: auto 1fr;
  column-gap: clamp(48px, 7vw, 100px);
  width: min(1100px, 100%);
  padding: clamp(32px, 5vw, 64px);
  border-radius: 24px;
  border-top: 4px solid var(--gold);
  box-shadow: 0 20px 70px #00000008;
}
.gate-card .brandmark {
  grid-column: 1;
  grid-row: 1;
  /* A late tenant logo must not move the sign-in form below its monogram. */
  flex: 0 0 112px;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  min-width: 0;
  height: 112px;
  min-height: 112px;
  margin: 0 0 36px;
  padding: 0;
  border: 0;
  text-align: left;
}
.gate-card .brandmark .wordmark { display: none; }
.gate-card .brandmark .logo {
  width: 240px;
  height: 112px;
  max-width: 100%;
  object-fit: contain;
  object-position: left center;
}
.gate-card > .entry-toolbar { grid-column: 2; grid-row: 1; align-self: start; }
#gatebody { grid-column: 2; grid-row: 2; min-width: 0; }
.auth-story { grid-column: 1; grid-row: 2; padding-right: 12px; }
.auth-role,
.gate-card .auth-kicker {
  font: 600 0.8125rem var(--f-body);
  text-transform: none;
  letter-spacing: 0;
  color: var(--gold-dp);
  margin: 0 0 16px;
}
.auth-story h2 { font-size: clamp(2.5rem, 4vw, 3.75rem); line-height: 1.05; margin: 0 0 24px; }
.auth-story > p:not(.auth-role) { color: var(--ink-2); line-height: 1.7; max-width: 35ch; }
.auth-story ul { list-style: none; margin: 32px 0 0; padding: 0; }
.auth-story li { border-top: 1px solid var(--rule); padding: 16px 0; }
.auth-story b { display: block; font-size: 0.875rem; font-weight: 600; }
.auth-story li span { display: block; margin-top: 4px; color: var(--ink-2); font-size: 0.8125rem; }
.gate .gate-card h1,
.entry h1 { font-size: clamp(2rem, 3vw, 2.75rem); line-height: 1.1; letter-spacing: -0.035em; margin: 0 0 16px; }
.gate .gate-card .sub { margin: 0 0 30px; }
.gate-card .f > span { text-transform: none; letter-spacing: 0; font-weight: 600; }
.gate #signin input,
.entry .field :is(input, select).input { min-height: 52px; font-size: 1rem; border-radius: 10px; }
.gate .gate-card .f { margin-bottom: 22px; }
.gate-card .f > .entry-password {
  display: flex;
  position: relative;
  margin: 0;
}
.entry-password input { width: 100%; padding-right: 72px; }
.entry-password button {
  position: absolute;
  right: 5px;
  top: 4px;
  min-height: 44px;
  padding: 8px 12px;
  border: 0;
  background: transparent;
  color: var(--gold-dp);
  font: 600 0.8125rem var(--f-body);
  cursor: pointer;
}
.entry-account-link { margin: 24px 0 0; padding-top: 24px; border-top: 1px solid var(--rule); color: var(--ink-2); font-size: 0.8125rem; line-height: 1.7; }
.entry-account-link a { display: inline-flex; align-items: center; min-height: 44px; color: var(--gold-dp); }
.entry { grid-template-columns: minmax(300px, 0.85fr) minmax(0, 1fr); background: var(--paper); }
.entry-context {
  background: var(--card);
  border-right: 1px solid var(--line);
  border-top: 4px solid var(--gold);
  gap: 32px;
  padding: 38px clamp(28px, 4.5vw, 72px);
}
/* Reserve the final image slot before its tenant URL or intrinsic size arrives. */
.entry-logo { display: inline-flex; align-items: center; flex: 0 0 120px; height: 120px; min-height: 120px; max-width: 100%; }
.entry-logo img { width: 260px; height: 120px; max-width: 100%; max-height: 120px; object-fit: contain; object-position: left center; }
.entry-context h2 { font-size: clamp(2.25rem, 3.7vw, 3.5rem); letter-spacing: -0.035em; }
.entry-journey { list-style: none; padding: 0; counter-reset: entry-step; }
.entry-journey li { display: flex; gap: 14px; align-items: center; padding: 14px 0; margin: 0; border-top: 1px solid var(--line); }
.entry-journey li::before {
  counter-increment: entry-step;
  content: counter(entry-step);
  flex: 0 0 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border: 1px solid var(--gold-line);
  border-radius: 50%;
  font-size: 0.75rem;
  color: var(--gold-dp);
}
.entry-main { padding: 40px clamp(24px, 4.5vw, 72px); }
.entry-content { width: min(100%, 480px); }
.entry-intro { max-width: 45ch; line-height: 1.65; }
.entry .auth-switch { padding: 0; gap: 24px; border: 0; border-bottom: 1px solid var(--line); background: transparent; border-radius: 0; margin-bottom: 28px; }
.entry .auth-switch > * { flex: none; min-width: 80px; border-bottom: 3px solid transparent; border-radius: 0; padding: 12px 8px; color: var(--ink-2); }
.entry .auth-switch > [aria-current='page'] { background: transparent; color: var(--gold-dp); border-color: var(--gold); }
.entry .journal-password button { top: 4px; min-height: 44px; }
.gate-card .btn.gold,
.entry .btn.primary {
  min-height: 52px;
  border-radius: 10px;
  border: 1px solid var(--gold);
  background: var(--gold);
  color: var(--on-gold, #17201d);
  font-weight: 700;
  box-shadow: none;
}
.gate-card .btn.gold:hover,
.entry .btn.primary:hover { background: var(--gold-hi); border-color: var(--gold-hi); color: #17201d; }
.entry .btn.ghost { color: var(--ink-2); }
.entry-help { margin-top: 24px; padding-top: 18px; }
.entry-help a { text-underline-offset: 4px; }
.gate > .built { font-family: var(--f-body); letter-spacing: 0; text-transform: none; margin-top: 24px; }
/* The supplied transparent mark sits on white or black to match the theme. */
html[data-theme='light'] .gate-card .brandmark .logo,
html[data-theme='light'] .entry-logo img { filter: brightness(0.55) saturate(1.05); }
html[data-theme='dark'] .gate-card,
html[data-theme='dark'] .entry-context { background: var(--card); }
html[data-theme='dark'] .gate-card .brandmark .logo,
html[data-theme='dark'] .entry-logo img { background: transparent; filter: none; }
/* Sign out remains visible as an account action in both themes. */
.rail-foot .btn[data-act='auth:signout'],
.journal-app .btn[data-act='sign-out'],
.journal-app .btn[data-act='session-signout'] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: var(--gold-dp);
  border: 1px solid var(--gold-line);
  background: var(--gold-wash);
  min-height: 44px;
  font-weight: 600;
}
.rail-foot .btn[data-act='auth:signout']:hover,
.journal-app .btn[data-act='sign-out']:hover,
.journal-app .btn[data-act='session-signout']:hover { border-color: var(--gold-dp); background: var(--card); }
.rail-foot .btn[data-act='auth:signout'] svg { width: 18px; height: 18px; stroke-width: 1.8; }
@media (max-width: 900px) {
  .gate-card { column-gap: 36px; padding: 32px; }
  .entry-context { padding-inline: 28px; }
  .entry-main { padding-inline: 28px; }
  .entry-toolbar { gap: 8px; }
}
@media (max-width: 700px) {
  .gate { padding: 20px; justify-content: flex-start; }
  .gate-card { display: flex; flex-direction: column; padding: 24px; border-radius: 18px; }
  .gate-card .brandmark { flex-basis: 94px; height: 94px; min-height: 94px; margin-bottom: 18px; }
  .gate-card .brandmark .logo { width: 210px; height: 94px; }
  .auth-story { display: none; }
  .gate-card .entry-toolbar { width: 100%; margin-bottom: 30px; }
  .entry { display: block; }
  .entry-context { position: relative; height: auto; padding: 14px 24px; border-right: 0; }
  .entry-logo { flex-basis: 80px; height: 80px; min-height: 80px; }
  .entry-logo img { width: 190px; height: 80px; max-height: 80px; }
  .entry-context > div, .entry-journey, .entry-context .built { display: none; }
  .entry-main { padding: 24px 24px 40px; }
  .entry-content { max-width: 560px; margin: 0; }
  .entry-toolbar { margin-bottom: 30px; }
  .entry-mobile-footer { display: block; }
}
@media (max-width: 360px) {
  .gate { padding: 12px; }
  .gate-card { padding: 22px 18px; }
  .entry-main, .entry-context { padding-inline: 20px; }
  .entry-theme { padding-inline: 9px; }
}
@media (max-height: 760px) and (min-width: 701px) {
  .entry-context { position: relative; height: auto; min-height: 100dvh; }
}
@media print { .entry-toolbar, .auth-story { display: none; } }
