/* RoofStone mobile profile 1: retain the existing account and Face ID flow. */
#pk-profile-open {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  min-height: 44px;
  max-width: 260px;
  padding: 5px;
  border: 1px solid transparent;
  border-radius: 12px;
  color: #374253;
  touch-action: manipulation;
}
#pk-profile-open:hover { background: #fff5f6; }
#pk-profile-open:focus-visible { outline: 3px solid #d95364; outline-offset: 2px; }
#pk-profile-open #user-initials {
  display: grid;
  place-items: center;
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  border-radius: 10px;
}
#pk-profile-open #header-user {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: left;
  line-height: 1.35;
}
#pk-profile-dialog {
  box-sizing: border-box;
  width: min(640px, calc(100% - 24px));
  max-width: calc(100% - 24px);
  max-height: calc(100dvh - 24px);
  margin: auto;
  border: 1px solid #e3e7ed;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}
#pk-profile-dialog .pk-profile-head { align-items: flex-start; }
#pk-profile-dialog .pk-profile-head > div,
#pk-profile-dialog .pk-security,
#pk-profile-dialog .pk-identity > div,
#pk-profile-dialog .pk-security form,
#pk-profile-dialog .pk-security label { min-width: 0; }
#pk-profile-dialog .pk-profile-head button { flex-shrink: 0; }
#pk-profile-dialog .pk-security input {
  display: block;
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  min-height: 48px;
  padding: 12px 13px;
  border: 1px solid #d6dde7;
  border-radius: 11px;
  background: #fff;
  color: #263140;
  font: inherit;
  font-size: 16px;
  line-height: 1.35;
  -webkit-appearance: none;
  appearance: none;
}
#pk-profile-dialog .pk-security input:focus {
  border-color: #b72f45;
  outline: 2px solid #f7dce1;
  outline-offset: 1px;
}
#pk-profile-dialog .pk-key-row { flex-wrap: wrap; }
#pk-profile-dialog .pk-key-row > div { flex: 1 1 180px; }
#pk-profile-dialog .pk-key-row p,
#pk-profile-dialog .pk-security > p,
#pk-profile-dialog .pk-security form p,
#pk-profile-dialog .pk-message { overflow-wrap: anywhere; }
#pk-profile-dialog button { min-height: 44px; white-space: normal; }
@media (max-width: 900px) {
  #app-screen .workspace-top { gap: 10px; }
  #app-screen .workspace-top .top-left { min-width: 0; flex: 1 1 auto; }
  #app-screen .workspace-top .top-right { min-width: 0; flex: 0 1 auto; gap: 8px; }
  #pk-profile-open { max-width: 180px; flex-shrink: 1; }
}
@media (max-width: 700px) {
  #app-screen .workspace-top {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    height: auto;
    min-height: 104px;
    padding: 10px 14px;
    gap: 6px;
  }
  #app-screen .workspace-top .top-left,
  #app-screen .workspace-top .top-right { width: 100%; min-width: 0; flex: 0 0 auto; }
  #app-screen .workspace-top .top-left { gap: 10px; min-height: 38px; }
  #app-screen .workspace-top .top-right { gap: 8px; }
  #app-screen .workspace-top .top-right .environment { display: none; }
  #pk-profile-open { flex: 1 1 0; max-width: none; gap: 9px; justify-content: flex-start; padding: 4px; }
  #pk-profile-open #header-user { font-size: 13px; }
  #app-screen .workspace-top #logout-button,
  #app-screen .workspace-top #users-shortcut { flex-shrink: 0; min-width: 44px; min-height: 44px; }
  #app-screen .workspace-top #users-shortcut .users-shortcut-label { display: none; }
  #pk-profile-dialog {
    width: calc(100% - 20px);
    max-width: calc(100% - 20px);
    max-height: calc(100dvh - 20px);
    padding: 18px;
    border-radius: 18px;
    scroll-padding: 18px;
  }
  #pk-profile-dialog .pk-identity { grid-template-columns: minmax(0, 1fr); }
  #pk-profile-dialog .pk-security form { padding: 13px; }
  #pk-profile-dialog .pk-form-actions { display: grid; grid-template-columns: minmax(0, 1fr); }
  #pk-profile-dialog .pk-form-actions button { width: 100%; min-width: 0; }
  #login-screen .login-card input { min-width: 0; max-width: 100%; min-height: 48px; font-size: 16px; }
}
