.mobile-nav {
  position: fixed;
  z-index: 25;
  right: 10px;
  bottom: max(10px, env(safe-area-inset-bottom));
  left: 10px;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  min-height: 66px;
  padding: 6px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.78), rgba(247, 243, 252, 0.62));
  box-shadow: 0 18px 46px rgba(41, 31, 54, 0.17),
    inset 0 1px 0 rgba(255, 255, 255, 0.86),
    inset 0 -1px 0 rgba(255, 255, 255, 0.32);
  -webkit-backdrop-filter: saturate(180%) blur(24px);
  backdrop-filter: saturate(180%) blur(24px);
}

.brand-cluster {
  display: flex;
  min-width: 0;
  gap: 6px;
  align-items: center;
}

.mobile-nav button {
  display: grid;
  min-width: 0;
  gap: 2px;
  padding: 6px 2px;
  place-items: center;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--muted);
  font-size: 0.59rem;
}

.mobile-nav button > span,
.mobile-nav button > .ui-icon {
  width: 1.2em;
  height: 1.2em;
  font-size: 1rem;
}

.mobile-nav button.active {
  background: rgba(238, 233, 255, 0.78);
  color: var(--purple);
  font-weight: 850;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.58);
}

.mobile-fab {
  position: fixed;
  z-index: 26;
  right: 18px;
  bottom: calc(max(10px, env(safe-area-inset-bottom)) + 78px);
  display: grid;
  width: 52px;
  height: 52px;
  padding: 0;
  place-items: center;
  border: 0;
  border-radius: 17px;
  background: var(--purple);
  color: #ffffff;
  font-size: 1.55rem;
  box-shadow: 0 12px 28px rgba(115, 86, 237, 0.35);
}

.modal-backdrop {
  position: fixed;
  z-index: 100;
  inset: 0;
  display: none;
  align-items: flex-end;
  justify-content: center;
  padding: max(28px, calc(env(safe-area-inset-top) + 8px)) 0 0;
  background: rgba(32, 24, 42, 0.45);
  backdrop-filter: blur(5px);
}

.modal-backdrop.open {
  display: flex;
}

.modal-sheet,
.detail-sheet {
  width: 100%;
  max-height: calc(100vh - max(28px, calc(env(safe-area-inset-top) + 8px)));
  max-height: calc(100dvh - max(28px, calc(env(safe-area-inset-top) + 8px)));
  max-width: 100vw;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain none;
  padding: 20px 20px calc(20px + env(safe-area-inset-bottom));
  border-radius: 24px 24px 0 0;
  background: var(--surface);
  box-shadow: 0 30px 90px rgba(30, 19, 48, 0.3);
  transform: translateY(var(--sheet-drag-y, 0));
  transition: transform var(--motion-duration-standard) var(--motion-ease-standard);
  touch-action: pan-y;
}

.modal-sheet form,
.modal-sheet .field,
.modal-sheet input,
.modal-sheet select,
.modal-sheet textarea {
  min-width: 0;
  max-width: 100%;
}

.modal-sheet .field {
  margin-bottom: 0;
}

.modal-sheet .field input:not([type="file"]),
.modal-sheet .field select {
  display: block;
  width: 100%;
  height: var(--control-height);
  min-height: var(--control-height);
  line-height: normal;
}

.modal-sheet input[type="date"],
.modal-sheet input[type="time"] {
  inline-size: 100%;
  min-inline-size: 0;
  max-inline-size: 100%;
  -webkit-appearance: none;
  appearance: none;
}

.sheet-handle {
  width: 42px;
  height: 4px;
  margin: -8px auto 16px;
  border-radius: 5px;
  background: var(--border);
}

.type-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 18px 0;
}

.type-button {
  display: grid;
  min-width: 0;
  gap: 6px;
  padding: 12px 4px;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 13px;
  background: var(--surface-soft);
  font-size: 0.68rem;
}

.type-button span {
  font-size: 1.1rem;
}

.type-button.selected {
  border-color: var(--purple);
  background: var(--purple-soft);
  color: var(--purple);
  font-weight: 800;
}

.modal-actions {
  justify-content: flex-end;
  margin-top: 18px;
}

.detail-heading {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) 38px;
  gap: 12px;
  align-items: center;
}

.detail-icon {
  display: grid;
  width: 52px;
  height: 52px;
  place-items: center;
  border-radius: 16px;
  background: linear-gradient(135deg, #f7c09b, #e77983);
  font-size: 1.3rem;
}

.detail-list {
  margin: 18px 0;
}

.detail-list > div {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr);
  gap: 10px;
  padding: 11px 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.78rem;
}

.detail-list dd {
  font-weight: 700;
}

.document-heading {
  margin-top: 18px;
}

.toast {
  position: fixed;
  z-index: 120;
  right: 16px;
  bottom: calc(max(10px, env(safe-area-inset-bottom)) + 82px);
  left: 16px;
  display: none;
  max-width: 440px;
  margin-left: auto;
  padding: 13px 15px;
  border-radius: 13px;
  background: #302a38;
  color: #ffffff;
  font-size: 0.76rem;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.22);
}

.toast.show {
  display: block;
  animation: view-in 160ms ease;
}

.login-body {
  background: var(--surface);
}

.login-main {
  min-height: 100vh;
}

.login-avatar { display: none; }

.login-art {
  position: relative;
  display: flex;
  min-height: 300px;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  padding: 28px 24px;
  background: linear-gradient(145deg, #6754ed, #a661dd 55%, #eb7183);
  color: #ffffff;
}

.login-art::before,
.login-art::after {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  content: "";
}

.login-art::before {
  top: -110px;
  right: -120px;
  width: 310px;
  height: 310px;
}

.login-art::after {
  bottom: -100px;
  left: -100px;
  width: 230px;
  height: 230px;
}

.brand img.brand-wordmark {
  width: 136px;
  height: auto;
  border-radius: 0;
}

.button-with-icon {
  display: inline-flex;
  gap: 7px;
  align-items: center;
  justify-content: center;
}

.button-icon {
  width: 1.15em;
  height: 1.15em;
  flex: 0 0 1.15em;
}

.login-art .brand,
.login-promise {
  position: relative;
  z-index: 1;
  color: #ffffff;
}

.login-art .brand img {
  width: 43px;
  height: 43px;
  border-radius: 13px;
}

.login-promise h1 {
  max-width: 440px;
  font-size: clamp(2rem, 8vw, 3.2rem);
  letter-spacing: -0.055em;
}

.login-promise p {
  max-width: 470px;
  margin-top: 13px;
  color: rgba(255, 255, 255, 0.82);
  line-height: 1.5;
}

.login-form-wrap {
  display: flex;
  padding: 34px 24px;
  justify-content: center;
}

.login-panel {
  width: min(440px, 100%);
}

.login-panel h2 {
  font-size: 1.75rem;
}

.login-panel .lead {
  margin: 7px 0 22px;
}

.login-panel .primary-button {
  width: 100%;
  margin-top: 5px;
}

.login-forgot-link,
.login-back-link {
  display: inline-block;
  color: var(--purple-strong);
  font-size: 0.84rem;
  font-weight: 750;
}

.login-forgot-link { margin: -4px 0 16px; }
.login-back-link { margin-top: 18px; }
.login-feedback {
  min-height: 1.4em;
  margin-top: 14px;
  color: var(--purple-strong);
  font-size: 0.84rem;
  line-height: 1.45;
}

.login-invitation {
  display: grid;
  gap: 4px;
  margin-bottom: 22px;
  padding: 15px 16px;
  border: 1px solid rgba(115, 86, 237, 0.22);
  border-radius: 14px;
  background: var(--purple-soft);
}

.login-invitation span,
.login-invitation small { color: var(--muted); }
.login-invitation span { font-size: 0.72rem; font-weight: 850; text-transform: uppercase; }
.login-invitation strong { color: var(--purple-strong); font-size: 1.05rem; }
.login-invitation small { line-height: 1.45; }

.login-switch,
.registration-actions .secondary-button {
  width: 100%;
  margin-top: 10px;
}

.registration-actions { display: grid; margin-top: 5px; }

.error {
  min-height: 1.4em;
  margin: 14px 0 0;
  color: #a23f4f;
  font-size: 0.8rem;
}
