/* Board login page — style.css tokens only. Full width: a quiet brand column left, the form column right; stacked on a phone. */
.lg-body { margin: 0; min-height: 100vh; background: var(--bg); color: var(--text); font-family: var(--font); font-size: var(--fs-lg);
  height: auto; overflow: visible auto; }   /* style.css locks body (board page: 100vh, overflow hidden); this page scrolls like a document */
.lg { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); min-height: 100vh; }
.lg-side { background: var(--bar); border-right: 1px solid var(--divider); padding: var(--sp-6); display: flex; flex-direction: column;
  justify-content: flex-end; gap: var(--sp-3); }
.lg-side { justify-content: flex-start; }
.lg-logo { display: block; width: 132px; }
.lg-logo img { display: block; width: 100%; height: auto; }
.lg-logo-dark { display: none !important; }
:root[data-theme="dark"] .lg-logo-light { display: none !important; }
:root[data-theme="dark"] .lg-logo-dark { display: block !important; opacity: .92; }
.lg-agents { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--sp-4) var(--sp-3); align-self: center; width: 100%; max-width: 520px; margin: auto 0; padding: var(--sp-5) 0; }
.lg-ag { display: flex; flex-direction: column; align-items: center; gap: var(--sp-1); min-width: 0; }
.lg-ag img { width: 100%; max-width: 96px; height: auto; aspect-ratio: 1; animation: lg-hop 2.6s ease-in-out infinite;
  transform-origin: 50% 100%; }
.lg-ag span { font-size: var(--fs-sm); color: var(--n-400); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.lg-ag-1 img { animation-delay: -.3s; } .lg-ag-2 img { animation-delay: -.9s; } .lg-ag-3 img { animation-delay: -1.5s; }
.lg-ag-4 img { animation-delay: -.6s; } .lg-ag-5 img { animation-delay: -2.1s; } .lg-ag-6 img { animation-delay: -1.2s; }
.lg-ag-7 img { animation-delay: -1.8s; } .lg-ag-8 img { animation-delay: -.45s; } .lg-ag-9 img { animation-delay: -2.4s; }
.lg-ag-10 img { animation-delay: -1.05s; } .lg-ag-11 img { animation-delay: -1.65s; }
@keyframes lg-hop {
  0%, 55%, 100% { transform: translateY(0) scale(1, 1); }
  62% { transform: translateY(0) scale(1.06, .92); }
  74% { transform: translateY(-14%) scale(.96, 1.05) rotate(-3deg); }
  86% { transform: translateY(0) scale(1.04, .95); }
  93% { transform: translateY(-3%) rotate(2deg); }
}
@media (prefers-reduced-motion: reduce) { .lg-ag img { animation: none; } }
.lg-brand { font-family: var(--font-head); font-size: var(--fs-2xl); font-weight: 600; margin: 0; }
.lg-note { margin: 0; color: var(--n-400); line-height: 1.5; }
.lg-main { padding: var(--sp-6); display: flex; flex-direction: column; justify-content: center; gap: var(--sp-4); background: var(--surface); }
.lg-step { display: flex; flex-direction: column; gap: var(--sp-3); }
.lg-step[hidden], .lg-main [hidden] { display: none !important; }
#form-totp, #form-totp-finish { display: flex; flex-direction: column; align-items: flex-start; gap: var(--sp-3); }   /* T-1423: the code box and its button no longer touch */
#form-totp .lg-field, #form-totp-finish .lg-field { align-self: stretch; }
#form-tg-code { display: flex; flex-direction: column; gap: var(--sp-3); }   /* T-1472: like #st-login — full-width field and button */
.lg-step h2 { font-family: var(--font-head); font-size: 22px; font-weight: 600; margin: 0 0 var(--sp-2); }
.lg-step h3 { font-size: var(--fs-lg); font-weight: 700; margin: var(--sp-4) 0 0; color: var(--n-400); }
.lg-field { display: flex; flex-direction: column; gap: var(--sp-1); }
.lg-field span { font-size: var(--fs-sm); color: var(--n-500); }
.lg-field .input { height: 40px; font-size: 15px; }
.lg-code { letter-spacing: .3em; font-family: var(--mono); }
.lg-muted { margin: 0; color: var(--n-400); line-height: 1.5; }
.lg-msg { margin: 0; padding: var(--sp-3) var(--sp-4); border-radius: var(--r-ctl); background: var(--danger-bg); color: var(--danger); }
.lg-msg.ok { background: var(--run-bg); color: var(--run-text); }
.lg-pk { background: var(--surface); }
.btn-link { align-self: flex-start; background: none; border: 0; padding: 0; font: inherit; color: var(--accent); cursor: pointer;
  text-decoration: underline; text-underline-offset: 3px; }
.lg-choices { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-3); }
.lg-choice { display: flex; flex-direction: column; gap: var(--sp-1); text-align: left; padding: var(--sp-4); font: inherit; color: var(--text);
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-card); cursor: pointer; }
.lg-choice:hover { background: var(--bg); }
.lg-choice strong { font-size: var(--fs-xl); }
.lg-choice span { color: var(--n-400); font-size: var(--fs); line-height: 1.45; }
.lg-qr { width: 220px; height: 220px; image-rendering: pixelated; border-radius: var(--r-ctl); border: 1px solid var(--divider); }
.lg-secret { margin: 0; font-family: var(--mono); font-size: var(--fs-lg); word-break: break-all; user-select: all; }
#st-login, #st-invite, #st-2fa, #st-locked, #st-off, #st-enroll, #st-tg, #st-tg-none { max-width: 520px; }
@media (max-width: 760px) {
  .lg { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr; }
  .lg-side { border-right: 0; border-bottom: 1px solid var(--divider); padding: var(--sp-5) var(--sp-4); gap: var(--sp-4); }
  .lg-logo { width: 104px; }
  .lg-agents { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: var(--sp-2); max-width: none; margin: 0; padding: 0; }
  .lg-ag:nth-child(n+7), .lg-ag span { display: none; }
  .lg-main { padding: var(--sp-5) var(--sp-4); justify-content: flex-start; }
  .lg-choices { grid-template-columns: minmax(0, 1fr); }
  #st-login, #st-invite, #st-2fa, #st-locked, #st-off, #st-enroll, #st-tg, #st-tg-none { max-width: none; }
}

/* ---------- «Kirish va xavfsizlik» (#manage, T-1297) — only while that step is on screen ----------
   A narrow sticky mascot column, then one readable 720px column of cards: top bar (back · lock · logout),
   2nd step, password, open sign-ins, and the danger zone apart at the bottom. Login steps above keep their layout. */
.lg[data-step="st-manage"] .lg-side { position: sticky; top: 0; height: 100vh; box-sizing: border-box; gap: 0;
  padding: var(--sp-6) var(--sp-5); overflow: hidden; }
/* same width and mascot size as the login step (no jump between them); the grid starts at the page title's height */
.lg[data-step="st-manage"] .lg-agents { margin: 56px 0 var(--sp-6); }
.lg[data-step="st-manage"] .lg-note { margin-bottom: auto; }
.lg[data-step="st-manage"] .lg-main { justify-content: flex-start; background: var(--bg); padding: var(--sp-6) var(--sp-6) 64px; }
.lg[data-step="st-manage"] .lg-main > * { width: 100%; max-width: 720px; align-self: center; box-sizing: border-box; }

.mg { gap: var(--sp-4); }
.mg .ic { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.mg-top { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); min-height: 32px; }
.mg-back { display: inline-flex; align-items: center; gap: var(--sp-1); margin-left: -6px; padding: 6px 8px 6px 4px; border-radius: var(--r-ctl);
  color: var(--n-400); text-decoration: none; font-size: var(--fs-lg); }
.mg-back:hover { color: var(--text); background: var(--n-900); }
.mg-top-acts { display: flex; gap: var(--sp-2); }
.mg-head { margin: var(--sp-2) 0 var(--sp-2); }
.mg-head h2 { font-size: var(--fs-2xl); margin: 0 0 var(--sp-1); }

.mg-card { background: var(--surface); border-radius: var(--r-card); box-shadow: var(--shadow-card); padding: var(--sp-5);
  display: flex; flex-direction: column; gap: var(--sp-4); }
.mg-card-head h3 { margin: 0; font-size: var(--fs-xl); font-weight: 700; color: var(--text); }
.mg-card-head p, .mg-danger-text p { margin: var(--sp-1) 0 0; color: var(--n-400); font-size: var(--fs); line-height: 1.5; }
.mg-card-foot { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2); }
.mg-card-foot:not(:has(> :not([hidden]))) { display: none; }

.mg-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--divider); }
.mg-row:last-child { border-bottom: 0; }
.mg-row { display: grid; grid-template-columns: 32px minmax(0, 1fr) auto; align-items: center; gap: var(--sp-3);
  padding: var(--sp-3) 0; border-bottom: 1px solid var(--divider); min-height: 40px; }
.mg-row-ic { width: 32px; height: 32px; border-radius: var(--r-ctl); display: grid; place-items: center; background: var(--n-900); color: var(--n-400); }
.mg-row-ic .ic { width: 18px; height: 18px; }
.mg-row-title { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-1) var(--sp-2); min-width: 0; }
.mg-row-name { font-weight: 600; color: var(--text); overflow-wrap: anywhere; }
.mg-row-sub { margin-top: 2px; color: var(--n-500); font-size: var(--fs); overflow-wrap: anywhere; }
.mg-row-sub time { color: var(--n-400); }
.mg-nowrap { white-space: nowrap; }
@media (max-width: 760px) {
  .mg-row-sub { display: flex; flex-wrap: wrap; column-gap: var(--sp-3); }
  .mg-sep { display: none; }
}
.mg-row-side { display: flex; align-items: center; gap: var(--sp-2); justify-self: end; }
.mg ::selection { background: var(--accent-900); color: var(--accent-200); }
.mg-quiet-note { color: var(--n-500); font-size: var(--fs-sm); }
.mg-empty { padding: var(--sp-3) 0; color: var(--n-400); }
.mg-pill { display: inline-block; padding: 1px 8px; border-radius: var(--r-pill); font-size: var(--fs-sm); font-weight: 600; line-height: 18px;
  white-space: nowrap; color: var(--idle-text); background: var(--idle-bg); }
.mg-pill.me { color: var(--accent-200); background: var(--accent-900); box-shadow: inset 0 0 0 1px var(--accent-800); }

.btn.mg-del { color: var(--danger); background: transparent; border-color: transparent; }
.btn.mg-del:hover, .btn.mg-del:focus-visible { background: var(--danger-bg); }
@media (hover: hover) and (pointer: fine) {          /* a rare action: shown on the row's hover or keyboard focus (gate 5) */
  .mg-row .mg-del { opacity: 0; }
  .mg-row:hover .mg-del, .mg-row:focus-within .mg-del { opacity: 1; }
}
.mg-ask { color: var(--text); font-size: var(--fs); font-weight: 600; }

.mg-form { display: flex; flex-direction: column; gap: var(--sp-4); }
.mg-field { display: flex; flex-direction: column; gap: 6px; max-width: 360px; }
.mg-field label { font-size: var(--fs); font-weight: 600; color: var(--n-400); }
.mg-field .input { height: 40px; font-size: 15px; box-sizing: border-box; width: 100%; }
/* browser autofill paints the field blue-grey; keep our field colours (dark and light) */
.mg-field .input:-webkit-autofill, .mg-field .input:-webkit-autofill:hover, .mg-field .input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--text); caret-color: var(--text); box-shadow: 0 0 0 40px var(--surface) inset;
  transition: background-color 9999s; }
.mg-field .input[aria-invalid="true"] { border-color: var(--danger); }
.mg-field .input[aria-invalid="true"]:focus { outline-color: var(--danger); }
.mg-err { margin: 0; color: var(--danger); font-size: var(--fs); }
.mg-hint { margin: 0; color: var(--n-500); font-size: var(--fs); line-height: 1.45; }
.mg-form-acts { display: flex; }
.mg .btn-primary { height: 36px; padding: 0 16px; font-size: var(--fs-lg); }
.mg .btn:focus-visible, .mg-back:focus-visible { outline: none; box-shadow: var(--shadow-focus); }
.mg .btn:disabled { opacity: .55; cursor: progress; }
.mg .btn-primary:disabled:hover { background: var(--accent-fill); }

.mg-note { display: flex; align-items: flex-start; gap: var(--sp-2); margin: 0; padding: var(--sp-2) var(--sp-3); border-radius: var(--r-ctl);
  font-size: var(--fs); line-height: 1.45; background: var(--danger-bg); color: var(--danger); }
.mg-note .ic { margin-top: 1px; }
.mg-note.ok { background: var(--run-bg); color: var(--run-text); }

.mg-danger { flex-direction: row; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--sp-3) var(--sp-5);
  margin-top: var(--sp-4); background: transparent; box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--danger) 35%, var(--border)); }
.mg-danger-text { flex: 1 1 320px; min-width: 0; }
.mg-danger-text h3 { margin: 0; font-size: var(--fs-xl); font-weight: 700; }
.mg-danger-acts { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2); }
.mg-danger .mg-note { flex-basis: 100%; }
.btn.mg-btn-danger { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 50%, var(--border)); background: transparent; font-weight: 600; }
.btn.mg-btn-danger:hover { background: var(--danger-bg); }

@media (max-width: 760px) {
  .lg[data-step="st-manage"] { grid-template-columns: minmax(0, 1fr); }
  .lg[data-step="st-manage"] .lg-side { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center;
    justify-content: space-between; gap: var(--sp-3); padding: var(--sp-4); }
  .lg[data-step="st-manage"] .lg-logo { width: 92px; }
  .lg[data-step="st-manage"] .lg-agents { grid-template-columns: repeat(6, 28px); gap: var(--sp-2); margin: 0; max-width: none; width: auto; }
  .lg[data-step="st-manage"] .lg-ag img { max-width: 28px; }
  .lg[data-step="st-manage"] .lg-brand, .lg[data-step="st-manage"] .lg-note { display: none; }
  .lg[data-step="st-manage"] .lg-main { padding: var(--sp-3) var(--sp-4) var(--sp-6); }
  .mg-card { padding: var(--sp-4); }
  .mg-head h2 { font-size: 22px; }
  .mg-field { max-width: none; }
  .mg-row { align-items: start; }
  .mg-row > .mg-row-side.asking { grid-column: 2 / -1; justify-self: start; }   /* «O'chirilsinmi? Bekor O'chirish» gets the row's width */
  .mg-danger { flex-direction: column; align-items: stretch; }
  .mg-danger-text { flex-basis: auto; }
}

.lg-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.mg-err:not([hidden]) + .mg-hint { display: none; }   /* the red line replaces the hint, never two lines saying the same */
