/* Login part. Colours, corners and sizes come from the shell's variables, so light, dark
   and any design profile follow by themselves. Tap targets are 48 px (--tap). */

.lg-btn { gap: 6px; }
.lg-btn svg.ico { width: 22px; height: 22px; }
.lg-avatar {
  display: inline-grid; place-items: center;
  width: 32px; height: 32px; border-radius: 50%;
  font-weight: 700; font-size: 15px; line-height: 1;
  background: color-mix(in srgb, var(--bar-ink, var(--on-accent)) 22%, transparent);
  color: var(--bar-ink, var(--on-accent));
  border: 2px solid color-mix(in srgb, var(--bar-ink, var(--on-accent)) 55%, transparent);
}
.lg-avatar.owner { border-color: var(--bar-ink, var(--on-accent)); }
.lg-avatar.big {
  width: 56px; height: 56px; font-size: 24px; flex: none;
  background: var(--accent-soft); color: var(--accent); border-color: var(--accent);
}

/* The sign-in, account, PIN and invite sheets are the shell's own bottom sheet (SHELL.md, "Bottom
   sheets"): its body is the only scroller and it caps the height, so the part sets neither. The
   class .lg-sheet stays on the sheet: part.js finds an open one by it (one sign-in sheet at a time).
   The account sheet's name row keeps clear of the sheet's X, as the shell does for a first heading. */
.sheet-body > .lg-who:first-child { margin-right: 44px; }
.lg-form { display: flex; flex-direction: column; gap: 12px; }
.lg-form h2 { margin: 0; }
.lg-form > p { margin: 0; color: var(--muted); font-size: 15px; }
.lg-field { display: flex; flex-direction: column; gap: 6px; }
.lg-label { font-size: 14px; font-weight: 600; color: var(--muted); }
.lg-note { font-size: 13px; color: var(--muted); }
.lg-pin { font-size: 20px; letter-spacing: .18em; }
.lg-row { display: flex; justify-content: flex-end; margin-top: -6px; }
.lg-link {
  min-height: var(--tap, 48px); padding: 0 4px; border: 0; background: transparent;
  color: var(--accent); font: inherit; font-size: 15px; font-weight: 600;
}
.lg-reason {
  margin: 0; padding: 10px 12px; border-radius: var(--radius-input, 12px);
  background: var(--accent-soft); color: var(--text); font-size: 15px;
}
.lg-error {
  padding: 10px 12px; border-radius: var(--radius-input, 12px); font-size: 15px; font-weight: 500;
  background: color-mix(in srgb, var(--danger) 12%, var(--surface)); color: var(--text);
  border: 1px solid color-mix(in srgb, var(--danger) 45%, transparent);
}
.lg-error[hidden] { display: none; }

.lg-invite { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 4px; }
.lg-invite summary {
  min-height: var(--tap, 48px); display: flex; align-items: center;
  font-weight: 600; color: var(--accent); cursor: pointer; list-style: none;
}
.lg-invite summary::-webkit-details-marker { display: none; }
.lg-invite summary::after { content: "+"; margin-left: auto; font-size: 22px; font-weight: 400; }
.lg-invite[open] summary::after { content: "\2212"; }
.lg-invite[open] { display: flex; flex-direction: column; gap: 10px; }
.lg-invite p { margin: 0; }

.lg-who { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
/* A long name in a display face (Postcard's 26 px serif at 320 px wide) wraps inside the row
   instead of pushing the text box out under the sheet's X: the text box may shrink, and a word
   longer than the row breaks only where it has to. */
.lg-who > div { min-width: 0; }
.lg-who h2 { margin: 0; overflow-wrap: break-word; }
.lg-who p { margin: 2px 0 0; }
.lg-menu { display: flex; flex-direction: column; gap: 10px; }
.lg-menu .btn svg.ico { width: 20px; height: 20px; }
.lg-actions { margin-top: 6px; }

.auth-lock .screen-inner { max-width: 440px; }
.lg-locked { text-align: center; padding: 28px 0 24px; }
.lg-icon { border-radius: 22px; box-shadow: var(--shadow); }
.lg-title { margin: 14px 0 6px; }
.lg-lead { margin: 0 auto 18px; max-width: 34ch; }
.lg-card { text-align: left; }

/* DEMO email sign-in: a gentle hint under the email box, never an error page. */
.lg-hint { font-size: 14px; color: var(--text); padding: 6px 10px; border-radius: var(--radius-input, 12px); background: var(--accent-soft); }
.lg-hint[hidden] { display: none; }
.input.lg-bad { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.lg-email { font-size: 18px; }
.lg-go { min-height: 52px; font-size: 17px; }

/* ACCOUNTS (): email and password, Create an account, the emailed links, the owner's outbox. */
.lg-accounts .lg-row { justify-content: space-between; flex-wrap: wrap; }
.lg-new { margin-top: 16px; border-top: 1px solid var(--line); padding-top: 12px; display: flex; flex-direction: column; gap: 8px; }
.lg-new .lg-note { margin: 0; }
.lg-form .lg-lead { margin: 0; max-width: none; }
.lg-sent p { margin: 0; }
.lg-thumb-on { margin: 2px 0 4px; }
.lg-outbox { display: flex; flex-direction: column; gap: 10px; margin: 12px 0; }
.lg-mail { padding: 12px; display: flex; flex-direction: column; gap: 4px; }
.lg-mail-head { font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }
.lg-mail-subject { font-weight: 600; }
.lg-mail-link { min-height: var(--tap, 48px); display: inline-flex; align-items: center; color: var(--accent); font-weight: 600; }

/* PINS SET BY THE OWNER (, "pin_by_owner"): the name box's suggestions and the PIN box. Only drawn in such an app. */
.lg-owner-pins .lg-field { position: relative; }
.lg-suggest {
  display: flex; flex-direction: column; margin-top: 2px; overflow: hidden;
  border: 1px solid var(--line); border-radius: var(--radius-input, 12px); background: var(--surface);
}
.lg-suggest[hidden] { display: none; }
.lg-suggest-item {
  min-height: var(--tap, 48px); padding: 0 14px; border: 0; border-top: 1px solid var(--line);
  background: transparent; color: var(--text); font: inherit; font-size: 17px; font-weight: 600; text-align: left;
}
.lg-suggest-item:first-child { border-top: 0; }
.lg-suggest-item:active, .lg-suggest-item:focus-visible { background: var(--accent-soft); outline: none; }
.lg-pin-digits { font-size: 26px; letter-spacing: .5em; text-align: center; min-height: 56px; }

/* The Onboarding QR (owners, "onboarding_qr"): full screen, white whatever the phone's theme, the code as big
   as the screen allows, so a new person can scan it from arm's length. */
.lg-qr-page {
  position: fixed; inset: 0; z-index: 40; overflow: auto;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  padding: max(16px, env(safe-area-inset-top)) 8px max(16px, env(safe-area-inset-bottom));
  background: #ffffff; color: #111111; text-align: center;
}
.lg-qr-close {
  position: absolute; top: max(8px, env(safe-area-inset-top)); right: 8px;
  width: 56px; height: 56px; border: 0; border-radius: 50%; display: grid; place-items: center;
  background: #eef1f6; color: #111111;
}
.lg-qr-close svg { width: 28px; height: 28px; }
.lg-qr-title { font-family: var(--font-head, inherit); font-size: 30px; font-weight: 800; line-height: 1.1; color: var(--accent); padding: 0 56px; }
.lg-qr-box { background: #ffffff; padding: 0; }   /* the code carries its own white margin */
.lg-qr-img { display: block; width: min(calc(100vw - 16px), 64vh, 560px); height: auto; aspect-ratio: 1 / 1; image-rendering: pixelated; }
.lg-qr-lead { margin: 4px 0 0; font-size: 22px; font-weight: 800; }
.lg-qr-note { margin: 0; font-size: 17px; color: #333333; max-width: 26em; }
.lg-qr-missing { font-size: 18px; max-width: 18em; }
.lg-onboard-btn svg.ico { width: 22px; height: 22px; }

/* JOINING BY APPROVAL (, "signin": "approve"): "Who are you?" in big letters, one clear box, a big OK. */
.lg-approve .lg-who-title { display: block; margin: 0 0 4px; font-family: var(--font-head, inherit); font-size: 28px;
  font-weight: 800; line-height: 1.15; color: var(--text); }
.lg-who-box { font-size: 22px; font-weight: 700; min-height: 56px; text-align: center; }
.lg-ok { min-height: 56px; font-size: 20px; font-weight: 800; }
.lg-approve-alt { justify-content: center; margin-top: 6px; }
.lg-approve-alt .lg-link, .lg-oldpin { min-height: var(--tap, 48px); }
.lg-approve-note { color: var(--text); font-weight: 600; }
.lg-approve-wait { text-align: center; padding: 6px 0 10px; }
.lg-approve-wait .lg-lead { font-size: 18px; margin: 6px 0 14px; }
.lg-approve-wait .lg-wait-img { display: block; width: 100%; max-width: 420px; height: auto; margin: 0 auto 16px; border-radius: 14px; }
.lg-approve-spin { margin: 6px auto 14px; }
